Created
January 28, 2019 22:52
-
-
Save chukwuemekachm/ff81953a468e23c3591aca81702165d8 to your computer and use it in GitHub Desktop.
This is the index file and entry point for the router in the routes folder.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Router } from 'express'; | |
const router = Router(); | |
router.get('/', (req, res, next) => | |
res.status(200).json({ | |
message: 'Welcome to Books REST API by The JavaScript Dojo', | |
}), | |
); | |
router.all('*', (req, res, next) => | |
res.status(404).json({ | |
message: 'Route un-available', | |
}), | |
); | |
export default router; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment