Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
El-khamisi committed Jul 27, 2022
0 parents commit 94f7ae3
Show file tree
Hide file tree
Showing 19 changed files with 4,908 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/node_modules
.env
/tmp
/.wwebjs_auth
3 changes: 3 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
semi: true
singleQuote: true
printWidth: 150
28 changes: 28 additions & 0 deletions index.js
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;
Loading

0 comments on commit 94f7ae3

Please sign in to comment.