File size: 418 Bytes
d39d0c7 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | const express = require('express');
const path = require('path');
const app = express();
const PORT = process.env.PORT || 3000;
// 设置静态文件目录
app.use(express.static(path.join(__dirname, '/')));
// 启动服务
app.listen(PORT, () => {
console.log(`Server is running on http://localhost:${PORT}`);
console.log(`Open http://localhost:${PORT} in your browser to view the site.`);
});
|