Closed aidanho1188 closed 8 months ago
add create user endpoint and also implement it with create room endpoint to api/index.js.
// api/index.js import {Router} from 'express'; import {createUser} from './users'; import {addMessage} from './messages'; import {createRoom} from './rooms'; const router = Router(); router.post('/rooms', createRoom); router.post('/users', createUser); router.post('/messages', addMessage); export default router;
There is another index.js file in the route folder, we will use it later as a main file to access all of the endpoints. Best MERN practice: https://github.com/nemanjam/mern-boilerplate/blob/master/server/src/routes/index.js close #7
add create user endpoint and also implement it with create room endpoint to api/index.js.
There is another index.js file in the route folder, we will use it later as a main file to access all of the endpoints. Best MERN practice: https://github.com/nemanjam/mern-boilerplate/blob/master/server/src/routes/index.js close #7