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