We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting exception error, added sample code only
import * as versionRouter from 'express-version-route'; import { Router, Handler, Request, Response } from 'express'; const routesMap = new Map<string, Handler>(); const route = Router();
export default (app: Router) => { app.use('/version-customer', route);
routesMap.set('1.0', (req, res, next) => { return res.status(200).json({ message: 'hello to you version 1.0' }); });
routesMap.set('default', (req, res, next) => { return res.status(200).json({ message: 'hello to you, this is the default route' }); });
route.get('/test', versionRouter.route(routesMap)); };
The text was updated successfully, but these errors were encountered:
I think you're not importing it correctly. What if you try the following import?
import versionRouter from 'express-version-route';
Sorry, something went wrong.
Thanks @LiranBri types were missing which causing the issue.
No branches or pull requests
Getting exception error, added sample code only
import * as versionRouter from 'express-version-route';
import { Router, Handler, Request, Response } from 'express';
const routesMap = new Map<string, Handler>();
const route = Router();
export default (app: Router) => {
app.use('/version-customer', route);
routesMap.set('1.0', (req, res, next) => {
return res.status(200).json({ message: 'hello to you version 1.0' });
});
routesMap.set('default', (req, res, next) => {
return res.status(200).json({ message: 'hello to you, this is the default route' });
});
route.get('/test', versionRouter.route(routesMap));
};
The text was updated successfully, but these errors were encountered: