🎓🍍 Checkpoint

./server.js:617503/85
./public/index.html:617503/8496
./public/style.css:617503/2290
./public/illustration.svg:617503/21272
This commit is contained in:
Glitch (hello-express) committed 2020-10-23 19:35:01 +00:00
1 parent 46972e6995
commit ea3b474ffa
6 files changed
+117 -91

No files matched your search

+2 -2
View File
@@ -8,12 +8,12 @@ const fastify = require("fastify")({
// Setup our static files
fastify.register(require('fastify-static'), {
root: path.join(__dirname, 'public'),
prefix: '/public/', // optional: default '/'
prefix: '/', // optional: default '/'
})
// Declare a route
fastify.get("/", function(request, reply) {
reply.send({ hello: "world" });
return reply.sendFile('index.html')
});
// Run the server!