This commit is contained in:
12
server.js
12
server.js
@@ -4,12 +4,10 @@ const crypto = require('crypto');
|
||||
|
||||
const csass = require("./compile_sass").compileSassMain();
|
||||
|
||||
const static_opts = {
|
||||
fastify.register(require('fastify-static'), {
|
||||
root: path.join(__dirname, 'public'),
|
||||
prefix: '/public/',
|
||||
};
|
||||
|
||||
fastify.register(require('fastify-static'), static_opts);
|
||||
});
|
||||
|
||||
fastify.register(require('fastify-leveldb'), {
|
||||
name: 'db'
|
||||
@@ -20,11 +18,11 @@ fastify.register(require('fastify-leveldb'), {
|
||||
|
||||
|
||||
fastify.get('/', (req, reply) => {
|
||||
reply.view('/template/home.html');
|
||||
reply.sendFile('/template/home.html');
|
||||
});
|
||||
|
||||
fastify.get('/dbg', (req, reply) => {
|
||||
reply.view('/template/templates.html');
|
||||
reply.sendFile('/template/templates.html');
|
||||
});
|
||||
|
||||
fastify.get('/:id', (req, reply) => {
|
||||
@@ -46,7 +44,7 @@ fastify.get('/:id', (req, reply) => {
|
||||
throw undefined;
|
||||
}
|
||||
}catch(e){
|
||||
reply.view('/template/journey.html');
|
||||
reply.sendFile('/template/journey.html');
|
||||
}
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user