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

Peerjs backend #5

Open
wants to merge 2 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
14 changes: 13 additions & 1 deletion app.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const express = require("express");
const app = express();
const http = require("http");
const server = http.createServer(app);

const middleware = require("./utils/middleware");

// initialisation of the router and the middlewares
app.use(middleware.requestLogger);

require("./routes/main")(app);
Expand All @@ -14,6 +14,18 @@ app.use(middleware.errorHandler);

require("./conference")(server);

//ends here

const server = http.createServer(app);
const peerServer = ExpressPeerServer(server, {
debug: true,
path: "/peerjs",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is this /peerjs path coming from?

});

// enables the peerjs server
app.use("/conference", peerService);

// deployment of the server
if (module === require.main) {
const PORT = process.env.PORT || 5000;
server.listen(PORT, () => {
Expand Down
Empty file removed configs/.gitkeep
Empty file.
Empty file removed models/.gitkeep
Empty file.
1 change: 0 additions & 1 deletion routes/main.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
module.exports = (app) => {
app.use("/api/v1/ping", require("./ping")); //Test routes
app.use("/api/v1/conference", require("./conference")); //Conference routes
};
8 changes: 0 additions & 8 deletions routes/ping.js

This file was deleted.

Empty file removed services/.gitkeep
Empty file.