mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-25 02:53:29 +03:00
35 lines
822 B
TypeScript
35 lines
822 B
TypeScript
// static server for web app
|
|
import express from 'express';
|
|
const app = express();
|
|
|
|
const PORT = process.env.PORT || 8080;
|
|
|
|
app.use('/', express.static('out'));
|
|
|
|
app.use('/_debug/*', express.static('out/_debug/*.html'));
|
|
app.use(
|
|
'/workspace/*/all',
|
|
express.static('out/workspace/[workspaceId]/all.html')
|
|
);
|
|
app.use(
|
|
'/workspace/*/setting',
|
|
express.static('out/workspace/[workspaceId]/all.html')
|
|
);
|
|
app.use(
|
|
'/workspace/*/shared',
|
|
express.static('out/workspace/[workspaceId]/shared.html')
|
|
);
|
|
app.use(
|
|
'/workspace/*/trash',
|
|
express.static('out/workspace/[workspaceId]/trash.html')
|
|
);
|
|
app.use(
|
|
'/workspace/*/*',
|
|
express.static('out/workspace/[workspaceId]/[pageId].html')
|
|
);
|
|
app.use('/*', express.static('out/404.html'));
|
|
|
|
app.listen(PORT, () => {
|
|
console.log(`Server is running on port ${PORT}`);
|
|
});
|