AFFiNE/apps/core/server.mts

16 lines
327 B
TypeScript
Raw Normal View History

2023-07-19 00:53:10 +08:00
// static server for web app
import express from 'express';
const app = express();
const PORT = process.env.PORT || 8080;
app.use('/', express.static('dist'));
app.get('/*', (req, res) => {
res.sendFile('index.html', { root: 'dist' });
});
app.listen(PORT, () => {
console.log(`Server is running on port ${PORT}`);
});