16 lines
438 B
JavaScript
16 lines
438 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.get('')
|
||
|
fastify.listen({ port: process.env.APP_PORT ?? 8000 }, (err, address) => {
|
||
|
if (err) throw err;
|
||
|
console.log(`Listening on ${address}`);
|
||
|
})
|