Skip to content

Instantly share code, notes, and snippets.

@chukwuemekachm
Created January 28, 2019 22:52
Show Gist options
  • Save chukwuemekachm/ff81953a468e23c3591aca81702165d8 to your computer and use it in GitHub Desktop.
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.
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