website: enable cors, allow requests to gaufre.js from any site

This commit is contained in:
Emmanuel Pelletier
2024-05-13 14:38:16 +02:00
parent 0593bbad15
commit eff5d0037e
3 changed files with 27 additions and 0 deletions

View File

@@ -1,11 +1,14 @@
import { join } from "path"
import Fastify from "fastify"
import fsfStatic from "@fastify/static"
import fsfCors from "@fastify/cors"
const fastify = Fastify({
logger: true,
})
fastify.register(fsfCors)
fastify.register(fsfStatic, {
root: join(import.meta.dirname, process.env.STATIC_DIR || "dist"),
preCompressed: true,