-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 94f7ae3
Showing
19 changed files
with
4,908 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/node_modules | ||
.env | ||
/tmp | ||
/.wwebjs_auth |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
semi: true | ||
singleQuote: true | ||
printWidth: 150 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
const express = require('express'); | ||
const {createServer} = require('http'); | ||
|
||
//Config | ||
const { PORT, NODE_ENV } = require('./src/config/env.js'); | ||
|
||
const port = PORT || 8080; | ||
|
||
|
||
//Create Application | ||
const app = express(); | ||
//Socket.io initialization | ||
const httpServer = createServer(app); | ||
|
||
const endpoints = require('./src/routes/index.routes'); | ||
endpoints(app, httpServer); | ||
|
||
if (NODE_ENV == 'dev') { | ||
httpServer.listen(process.argv[2], () => { | ||
console.log(`Development connected successfully ON PORT-${process.argv[2]}`); | ||
}); | ||
} else { | ||
httpServer.listen(port, () => { | ||
console.log(`Production connected successfully ON port-${port}`); | ||
}); | ||
} | ||
|
||
module.exports = httpServer; |
Oops, something went wrong.