initial commit on backend

parent 85cce12d
const express = require("express");
const app = express();
const bodyParser = require("body-parser");
const cors = require('cors');
require("./src/db/conn");
require("./src/models/User.model");
require("./src/models/Results.model");
const port = process.env.PORT || 3000;
app.use(cors());
app.use(bodyParser.json({limit: '50mb'}));
app.use(bodyParser.urlencoded({
limit: '50mb',
extended: true,
parameterLimit: 1000000
}));
app.use(express.static(__dirname + '/src/uploads'));
const routes = require("./src/api/Registration.api");
app.use('/', routes)
app.listen(port, () => {
console.log(`server is running at port no ${port}`);
})
\ No newline at end of file
{
"name": "backend",
"version": "1.0.0",
"description": "af group project back end ",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "nodemon app.js"
},
"author": "Sandunika Wasala",
"license": "ISC",
"dependencies": {
"body-parser": "^1.19.0",
"config": "^3.3.6",
"cors": "^2.8.5",
"csv-writer": "^1.6.0",
"dotenv": "^10.0.0",
"express": "^4.17.1",
"json2csv": "^5.0.7",
"mongoose": "^5.12.14",
"multer": "^1.4.2",
"nodemon": "^2.0.15"
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment