Skip to content
New issue

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

URL params issue #314

Open
niteesh1215 opened this issue Jul 26, 2022 · 0 comments
Open

URL params issue #314

niteesh1215 opened this issue Jul 26, 2022 · 0 comments

Comments

@niteesh1215
Copy link

niteesh1215 commented Jul 26, 2022

main.ts

import { Restivus } from 'meteor/nimble:restivus';
const RestApi = new Restivus({
	apiPath: '/api/',
	prettyJson: true,
	enableCors: false
});

api1.ts

import {RestApi } from './main';
RestApi.addRoute(':company/subscription', { authRequired: false }, {
	get: function () {
            //code ..
        }
});

api2.ts

import {RestApi } from './main';
RestApi.addRoute(':subscription/event', { authRequired: false }, {
	post: function () {
            //code ..
        }
});

This is how the code is divided into 3 files.
The issue is,
When I invoke the endpoint :company/subscription the url param that I get is

{
   subscription: "value"
}

instead of

{
   company: "value"
}

But when I invoke the endpoint :subscription/event I get the correct url param i.e.

{
   subscription: "value"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant