Files
integration/website/server.mjs
Emmanuel Pelletier 21521277b0 misc changes on website:
- correct a few content mistakes
- activate compression on production server
- suppress a few TS warnings (with anys, I know)
2024-05-02 09:48:59 +02:00

21 lines
442 B
JavaScript

import { join } from "path"
import Fastify from "fastify"
import fsfStatic from "@fastify/static"
import fsfCompress from "@fastify/compress"
const fastify = Fastify({
logger: true,
})
fastify.register(fsfCompress)
fastify.register(fsfStatic, {
root: join(import.meta.dirname, process.env.STATIC_DIR || "dist"),
})
try {
fastify.listen({ port: process.env.PORT || 3000 })
} catch (err) {
fastify.log.error(err)
process.exit(1)
}