12 lines
363 B
JavaScript
12 lines
363 B
JavaScript
const express = require('express');
|
|
const path = require('path');
|
|
const app = express();
|
|
const PORT = 3000; // 您可以根据需要更改端口号
|
|
|
|
// 设置静态文件目录
|
|
app.use('/files', express.static(path.join(__dirname, 'files')));
|
|
|
|
// 启动服务器
|
|
app.listen(PORT, () => {
|
|
console.log(`文件服务正在运行在 http://localhost:${PORT}`);
|
|
});
|