mirror of
https://github.com/docker/awesome-compose.git
synced 2025-04-25 18:28:07 +02:00
react-express-mongodb: rename server to backend
The goal here is to keep the same structure than the other examples. Also, considering that it has a "frontend" folder, the equivalent for the server should be "backend". Signed-off-by: Jérémie Drouet <jeremie.drouet@gmail.com>
This commit is contained in:
parent
e29f0d1c54
commit
be8875c9b6
16 changed files with 8 additions and 8 deletions
35
react-express-mongodb/server/server.js
vendored
35
react-express-mongodb/server/server.js
vendored
|
@ -1,35 +0,0 @@
|
|||
/**
|
||||
* Created by Syed Afzal
|
||||
*/
|
||||
require('./config/config');
|
||||
|
||||
const express = require('express');
|
||||
const path = require('path');
|
||||
const cookieParser = require('cookie-parser');
|
||||
const bodyParser = require('body-parser');
|
||||
const cors = require('cors');
|
||||
const db = require('./db');
|
||||
|
||||
|
||||
|
||||
const app = express();
|
||||
|
||||
//connection from db here
|
||||
db.connect(app);
|
||||
|
||||
app.use(cors());
|
||||
app.use(bodyParser.json());
|
||||
app.use(bodyParser.urlencoded({ extended: false }));
|
||||
app.use(cookieParser());
|
||||
app.use(express.static(path.join(__dirname, 'public')));
|
||||
|
||||
// adding routes
|
||||
require('./routes')(app);
|
||||
|
||||
app.on('ready', () => {
|
||||
app.listen(3000, () => {
|
||||
console.log("Server is up on port", 3000)
|
||||
});
|
||||
})
|
||||
|
||||
module.exports = app;
|
Loading…
Add table
Add a link
Reference in a new issue