Ask coding questions

← Back to all posts
Cannot Get / Error.
phyouthcenter1 (2)

I am trying to create a Roblox ranking module but it says "Cannot Get /".
Does anyone know hw to fix this?

Comments
hotnewtop
notGilbert (92)

it seems like there are no handlers for GET / but there are handlers for other routes

you'll need to add your own handler

app.get('/', (req, res) => {
  res.send('Hello World!'); // or do whatever you want with req or res
})
notGilbert (92)

@phyouthcenter1

looks like there are handlers for GET / when the configuration is invalid, but when the config is correct there is none

to add your own handler, just add this:

app.get('/', (req, res) => {
  res.send('Hello World!'); // or do whatever you want with req or res
})

to the code, after everything but the app.listen