Skip to content
This repository has been archived by the owner on Feb 26, 2020. It is now read-only.

Better routes #8

Open
Kotevode opened this issue Nov 22, 2017 · 2 comments
Open

Better routes #8

Kotevode opened this issue Nov 22, 2017 · 2 comments

Comments

@Kotevode
Copy link

Kotevode commented Nov 22, 2017

I don't really think that your routes are comfortable to use, for example:

GET /request_payment/:expect/:currency/:message/:seller/:customer/:callback_url

When you build a wrapper, joining these parameters is very tricky process: you should always match values with position. Maybe they should be passed via query string?

@Overtorment
Copy link
Owner

@Kotevode thanks for a suggestion! Perfectly valid point, but this is the default routing mechanism in Expressjs framework here.
If you can, please suggest an alternative.

@acalatrava
Copy link

AFAIK you can also use query string like this:

router.get('/request_payment', function(req, res) {
    var expect = req.query.expect;
    var currency = req.query.currency;
    var message = req.query.messge;
    ...
});

This should match a query like this:

GET /request_payment?currency=USD&message=This%20is%20your%20purchase&expect=100000

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants