Skip to content

Commit 56e9aa7

Browse files
author
Matheus Ishiyama
committed
create user route
1 parent 45e1cf9 commit 56e9aa7

File tree

5 files changed

+4816
-0
lines changed

5 files changed

+4816
-0
lines changed

package.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"name": "chat-app-backend",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "src/index.js",
6+
"scripts": {
7+
"dev": "nodemon src/index.js",
8+
"start": "node src/index.js",
9+
"test": "jest"
10+
},
11+
"repository": {
12+
"type": "git",
13+
"url": "git+https://github.com/MatheusIshiyama/chat-app-backend.git"
14+
},
15+
"keywords": [],
16+
"author": "",
17+
"license": "ISC",
18+
"bugs": {
19+
"url": "https://github.com/MatheusIshiyama/chat-app-backend/issues"
20+
},
21+
"homepage": "https://github.com/MatheusIshiyama/chat-app-backend#readme",
22+
"dependencies": {
23+
"dotenv": "^8.2.0",
24+
"express": "^4.17.1",
25+
"mongoose": "^5.12.3"
26+
},
27+
"devDependencies": {
28+
"jest": "^26.6.3",
29+
"nodemon": "^2.0.7",
30+
"supertest": "^6.1.3"
31+
}
32+
}

src/app.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const express = require("express");
2+
3+
//* express setup
4+
const app = express();
5+
app.use(express.json());
6+
app.use(express.urlencoded({ extended: true }));
7+
8+
//* routes
9+
app.use("/user", require("./routes/user"));
10+
11+
module.exports = app;

src/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
const app = require('./app');
2+
require('dotenv').config();
3+
4+
app.listen(process.env.PORT, () => console.log('[SERVER] Running'))

src/routes/user.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
const express = require("express");
2+
const userRoutes = express.Router();
3+
4+
userRoutes.get('/', (req, res) => {
5+
res.sendStatus(200);
6+
})
7+
8+
module.exports = userRoutes;

0 commit comments

Comments
 (0)