Change path.existsSync to fs.existsSync
Added CSRF and secure example