🏝🐈 Checkpoint
./server.js:617503/197
This commit is contained in:
@@ -1,8 +1,16 @@
|
||||
const path = require('path')
|
||||
|
||||
// Require the framework and instantiate it
|
||||
const fastify = require("fastify")({
|
||||
logger: true
|
||||
});
|
||||
|
||||
// Setup our static files
|
||||
fastify.register(require('fastify-static'), {
|
||||
root: path.join(__dirname, 'public'),
|
||||
prefix: '/public/', // optional: default '/'
|
||||
})
|
||||
|
||||
// Declare a route
|
||||
fastify.get("/", function(request, reply) {
|
||||
reply.send({ hello: "world" });
|
||||
|
||||
Reference in New Issue
Block a user