From 80a5f2f8d04d1fcf17c6bd8c027a322933367b74 Mon Sep 17 00:00:00 2001 From: "Glitch (hello-express)" Date: Thu, 9 Apr 2020 09:21:33 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=90=F0=9F=9A=9C=20Checkpoint=20./serve?= =?UTF-8?q?r.js:530995/714?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server.js | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/server.js b/server.js index 1df7216..6bbf6df 100644 --- a/server.js +++ b/server.js @@ -1,34 +1,12 @@ -// server.js -// where your node app starts - -// we've started you off with Express (https://expressjs.com/) -// but feel free to use whatever libraries or frameworks you'd like through `package.json`. const express = require("express"); const app = express(); -// our default array of dreams -const dreams = [ - "Find and count some sheep", - "Climb a really tall mountain", - "Wash the dishes" -]; - -// make all the files in 'public' available -// https://expressjs.com/en/starter/static-files.html app.use(express.static("public")); -// https://expressjs.com/en/starter/basic-routing.html -app.get("/", (request, response) => { +app.get("/:roomId/join", (request, response) => { response.sendFile(__dirname + "/views/index.html"); }); -// send the default array of dreams to the webpage -app.get("/dreams", (request, response) => { - // express helps us take JS objects and send them as JSON - response.json(dreams); -}); - -// listen for requests :) const listener = app.listen(process.env.PORT, () => { console.log("Your app is listening on port " + listener.address().port); });