15 lines
419 B
JavaScript
15 lines
419 B
JavaScript
require('dotenv').config();
|
|
const { APP_DEBUG } = process.env;
|
|
|
|
const fastify = require('fastify')({ logger: APP_DEBUG == 'true' });
|
|
const path = require('path');
|
|
|
|
fastify.register(require('@fastify/static'), {
|
|
root: path.join(__dirname, 'public'),
|
|
prefix: '/'
|
|
});
|
|
|
|
fastify.listen({ port: process.env.APP_PORT ?? 8000 }, (err, address) => {
|
|
if (err) throw err;
|
|
console.log(`Listening on ${address}`);
|
|
}) |