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

Different behaviour while used as an expressjs middleware #137

Open
evanslify opened this issue Jul 13, 2016 · 1 comment
Open

Different behaviour while used as an expressjs middleware #137

evanslify opened this issue Jul 13, 2016 · 1 comment
Labels

Comments

@evanslify
Copy link

The code I'm using is from the documentation:

// api.js
var express = require('express');
var drakov = require('drakov')
var drakovMiddleware = require('drakov').middleware;
var port = process.env.PORT || 3000;
var argv = {
    sourceFiles: './api.md',
    serverPort: port,
    staticPaths: [
        'static/',
    ],
    stealthmode: false,
    delay: 0,
    drakovHeader: true,
    public: true,
    disableCORS: true
};
var app = express();
drakovMiddleware.init(app, argv, function(err, middlewareFunction) {
    if (err) {
        throw err;
    }
    app.use(middlewareFunction);
    app.listen(argv.serverPort);

});

If I run the script from commandline node api.js, no route would work but the static hosted one.
But, if I am using drakov -f api.md -p 3000 from CLI, all routes would work as expected.

@yakovkhalinsky
Copy link
Contributor

Thanks for reporting @evanslify when I get a chance (possibly later this week) I will investigate

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

No branches or pull requests

2 participants