drivecore / server.js
Jasmine Wong
use express server
e5e9b2e
Raw
History Blame Contribute Delete
394 Bytes
import express from 'express';
import { fileURLToPath } from 'url';
import { dirname, join } from 'path';
const __dirname = dirname(fileURLToPath(import.meta.url));
const app = express();
app.use(express.static(join(__dirname, 'public')));
app.get('*', (req, res) => {
res.sendFile(join(__dirname, 'public', 'index.html'));
});
app.listen(7860, () => console.log('Running on port 7860'));