mirror of
https://gitlab.com/comunic/nodejs-webrtcsignalexchangerserver
synced 2024-11-24 06:19:27 +00:00
Initial commit - Added basic HTTP server
This commit is contained in:
commit
42a1ad4182
12
README.MD
Normal file
12
README.MD
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
# NodeSignalExchanger
|
||||||
|
|
||||||
|
A lightweight node application that allows to exchange signals connection through websockets.
|
||||||
|
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
```sh
|
||||||
|
sudo apt install nodejs node-express node-wc
|
||||||
|
```
|
||||||
|
|
||||||
|
## Author
|
||||||
|
Pierre HUBERT 2019
|
10
config.js
Normal file
10
config.js
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
/**
|
||||||
|
* Project configuration
|
||||||
|
*
|
||||||
|
* @author Pierre HUBERT
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The port into which the server listen
|
||||||
|
*/
|
||||||
|
exports.port = 8081;
|
31
index.js
Normal file
31
index.js
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
/**
|
||||||
|
* Project main module
|
||||||
|
*
|
||||||
|
* @author Pierre HUBERT
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Import requirements
|
||||||
|
*/
|
||||||
|
const express = require("express");
|
||||||
|
const app = express();
|
||||||
|
const WebSocket = require("ws");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Import project modules
|
||||||
|
*/
|
||||||
|
const config = require("./config");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If user tries to connect to home page,
|
||||||
|
* show a message to explains him what is the
|
||||||
|
* purpose of this service
|
||||||
|
*/
|
||||||
|
app.get("/", (req, res) => {
|
||||||
|
res.send("Welcome to NodeSignalExchanger!");
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
var server = app.listen(config.port, () => {
|
||||||
|
console.log("Application listening on port " + config.port);
|
||||||
|
})
|
Loading…
Reference in New Issue
Block a user