create-nodeapi-backend
Version:
A powerful Node.js backend boilerplate with Express, MongoDB, Firebase, JWT auth, Nodemailer, cron jobs, input validation (Joi), and serverless support for Vercel. Scaffold a full-featured API backend in seconds.
38 lines (33 loc) • 671 B
JavaScript
const express = require("express");
const auth = require("./auth");
const otp = require("./otp");
const userRouter = require("./user");
const googleOauth = require("./googleOauth");
const password = require("./password");
const router = express.Router();
const defaultRoutes = [
{
path: "/auth",
route: auth
},
{
path: "/otp",
route: otp
},
{
path: "/password",
route: password
},
{
path: "/user",
route: userRouter
},
{
path: "/googleOauth",
route: googleOauth
}
];
defaultRoutes.forEach((route) => {
router.use(route.path, route.route);
});
module.exports = router;