Answers for "API version control v1 v2 in NodeJs (loosely coupled)"

0

API version control v1 v2 in NodeJs (loosely coupled)

import * as express from 'express';

// v1/get-ride.js
const router = express.Router();
router.post('/rides/:id', dep.verifyToken(), (req, res) => {
    // Your code
});
app.use('/v1', router);


// v2/get-ride.js
const router = express.Router();
router.post('/rides/:id', dep.verifyToken(), (req, res) => {
    // Your code
});
app.use('/v2', router);
Posted by: Guest on May-10-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language