Skip to content

Commit 62908b3

Browse files
committed
Add model generation command and update hello response message in hello controller and route files
1 parent 361d2c9 commit 62908b3

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,12 @@ npm run prepare
1717
npm run start:dev
1818
```
1919

20-
## License
21-
[MIT](https://choosealicense.com/licenses/mit/)
20+
## Model Generation
21+
22+
```bash
23+
npx sequelize-cli model:generate --name user --attributes firstname:string,lastname:string,username:string,email:string,password:string,gender:string,active:integer,deleted:integer,token:string,token_expire:string,birthday:date,role:string
24+
```
25+
2226

2327
## Contributing
2428
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

controller/hello.controller.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11

22
const hello = (req, res) => {
3-
res.send('Hello World!')
3+
res.send({
4+
status: 'success',
5+
code : 200,
6+
data : {
7+
message: 'You are here now...'
8+
}
9+
})
410
}
511

612

route/hello.route.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ const router = express.Router();
44
const helloController = require('../controller/hello.controller.js');
55

66

7-
router.post('/', helloController.hello);
7+
router.get('/', helloController.hello);
88

99
module.exports = router;

0 commit comments

Comments
 (0)