freeptcha/index.js

15 lines
419 B
JavaScript
Raw Normal View History

2023-06-23 13:08:16 +02:00
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}`);
})