Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ejs #4

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# node mudules
node_modules
.env
30 changes: 30 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import express from 'express';
import httpModule from 'http';
import { Server } from 'socket.io';
import path from 'path';

import handleConnection from './events/connection.js';
import handleDisconnect from './events/disconnect.js';
import handleMessage from './events/message.js';

const app = express();
const http = httpModule.createServer(app);
const io = new Server(http);
const port = process.env.PORT || 3000;

app.use(express.static(path.resolve('public')));
app.set('view engine', 'ejs');

app.get('/', (request, response) => {
response.render('index');
});

io.on('connection', (socket) => {
handleConnection(socket);
handleDisconnect(socket);
handleMessage(socket, io);
});

http.listen(port, () => {
console.log(`listening on localhost:${port}`);
});
109 changes: 0 additions & 109 deletions course/college 1 - live code voorbeeld.md

This file was deleted.

45 changes: 0 additions & 45 deletions course/peer-review.md

This file was deleted.

102 changes: 0 additions & 102 deletions course/week-1.md

This file was deleted.

Loading