startpage/server.js

20 lines
382 B
JavaScript
Raw Permalink Normal View History

2021-06-22 12:06:23 +02:00
'use strict';
// Constants
const PORT = 8080;
const HOST = '0.0.0.0';
const fastify = require('fastify')()
const path = require('path')
2022-05-16 10:22:56 +02:00
fastify.register(require('@fastify/static'), {
root: path.join(__dirname),
})
2021-06-22 12:06:23 +02:00
fastify.get('/', function (req, reply) {
return reply.sendFile('index.html');
})
fastify.listen(PORT, HOST);
2022-05-16 10:21:57 +02:00
console.log(`Running on http://${HOST}:${PORT}`);