mirror of
https://github.com/LukeHagar/website.git
synced 2025-12-06 04:22:07 +00:00
20 lines
522 B
JavaScript
20 lines
522 B
JavaScript
import express from 'express';
|
|
import compression from 'compression'
|
|
import { sitemap } from './sitemap.js'
|
|
import { handler } from '../build/handler.js';
|
|
|
|
async function main() {
|
|
const app = express();
|
|
app.use(compression());
|
|
app.use(await sitemap());
|
|
app.use(function (_req, res, next) {
|
|
res.setHeader('Cache-Control', 'max-age=3600, no-cache');
|
|
next();
|
|
});
|
|
app.use(handler);
|
|
app.listen(3000, () => {
|
|
console.log('Listening on http://0.0.0.0:3000');
|
|
});
|
|
}
|
|
|
|
main(); |