R
R
RxApi
Search…
Routes/Controller
Files in "./http/routes/users.js"
1
const http = require('express').Router();
2
3
module.exports = db => {
4
5
http.get('/firstUser', (req, res) => {
6
db('users').insert({
7
username: "username",
8
surname: "surname",
9
password: "password"
10
})
11
.then(res => {
12
res.json(res)
13
})
14
.catch(err => {
15
res.json(err)
16
})
17
});
18
19
http.get('/bye', (req, res) => {
20
res.json({ response : "bye" });
21
});
22
23
return http;
24
};
Copied!
Copy link