📌  相关文章
📜  node express 服务器静态文件 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:53.289000             🧑  作者: Mango

代码示例1
var express = require('express');
var app = express();
var path = require('path');

//app.use(express.static(__dirname)); // Current directory is root
app.use(express.static(path.join(__dirname, 'public'))); //  "public" off of current is root

app.listen(80);
console.log('Listening on port 80');