有谁知道如何在托管共享主机中部署 nextjs 项目,我被困在这里。
托管提供商有 hpanel 而不是 cpanel,并且您没有任何安装 nodejs 的选项。
我很失望,我才订阅一年。现在我不知道该怎么办。
我尝试将构建的文件夹放在.nextpublic_html 文件夹中并将权限更改为755但什么也没有,页面显示
403 Forbidden “访问服务器上的此资源被拒绝!”
任何帮助表示赞赏。
我已经开始学习node.js用express的框架,当我张贴的形式是这样的:
router.get('/add-product',(req,res,next)=>{
res.send('<form action="/product" method="POST" ><input type="text" name="title" /><button type="submit">Submit</button></form>');
});
router.post('/product',(req,res,next)=>{
console.log(req.body);
res.redirect('/');
});
Run Code Online (Sandbox Code Playgroud)
当我这样做console.log(req.body)时显示:
[Object: null prototype] { title: 'product' }
Run Code Online (Sandbox Code Playgroud)
而不只是 { title: 'product' }
我想知道这是否实际上是express的错误,或者只是最近添加的express的专有性,原因是我下载了去年创建的另一个项目,并且当我console.log(req.body)显示相同的输出时,它使用了相同的方法。
在此先感谢您的帮助。