Let Express call File (index.html) itself. #5433
Unanswered
alokkksharmaa
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
https://socket.io/docs/v4/tutorial/step-2
import express from 'express';
import { createServer} from 'node:http';
import { fileURLToPath } from 'node:url';
import { dirname, join } from 'node:path';
const app = express();
const server = createServer(app);
const __dirname = dirname(fileURLToPath(import.meta.url));
app.use(express.static(join(__dirname, 'public')));
server.listen(3030, () => {
console.log(
server running at http://localhost:3030)});
Beta Was this translation helpful? Give feedback.
All reactions