![](/img/trans.png)
[英]My node.js server script is serving the index.html fine, but not the CSS or other static files
[英]Node.js not serving files other than index.html
您需要根據此鏈接http://expressjs.com/en/starter/static-files.html提供靜態文件。
因此,在您的zombie_dice中,您可以創建一個“ public”文件夾,將您的css和js文件放入此新文件夾中,並在app.use( express.static(path.join(__dirname, 'public')))
添加app.use( express.static(path.join(__dirname, 'public')))
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.