Ask coding questions

← Back to all posts
Cannot GET
MaxwellGeringer (0)

I am trying to use in my repl, but on the client side it tells me Cannot GET / The only solution I could find is to switch from using app.listen to http.listen but I have already done that but the same result occurs.

Answered by ruiwenge2 (551) [earned 5 cycles]
View Answer
ruiwenge2 (551)

do this:

const express = require('express');
const app = express();
const http = require('http');
const server = http.createServer(app);
const { Server } = require("");
const io = new Server(server);
MaxwellGeringer (0)

@ruiwenge2 Hmm, I tried that but it tells me that http.listen is not a function. I switched it to app.listen but it still gives me the Cannot GET error.

ruiwenge2 (551)

@MaxwellGeringer you can take a look at my chat website:

it uses maybe it will help