Giter Club home page Giter Club logo

totoro's People

Contributors

dependabot[bot] avatar espenhogbakk avatar lexod avatar melnele avatar tusharpandey13 avatar vgjohn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

totoro's Issues

Autogenerate swagger

Hi,

How to integrate swagger into totoro routes. I'm using
"swagger-autogen": "^2.18.8",
"swagger-ui-express": "^4.3.0"

Thanks

Ablity to use other loggers instead of winston

I noticed that totoro-node uses winston as the default logger. I am using morgan with a cusotm config and I would like if it can use my logger. Adding a feature to use other loggers would be useful.

next parameter is not being passed by totoro.

router.post('/' + endpoint.apiVersion + endpoint.endpoint, urlencodedParser, function(req, res) {
endpoint.endpointConfig.endpointImplementation(endpoint.apiVersion, req, res);
});
In current implementation of totoro next function is not considered. If we add next parameter in endpointImplemenation(actual function) then it shows undefined. If we need to pass error to global error handler we need next in endpointImplementation.
To handle this, we can change the code to
router.post('/' + endpoint.apiVersion + endpoint.endpoint, urlencodedParser, function(req, res, next) {
endpoint.endpointConfig.endpointImplementation(endpoint.apiVersion, req, res, next);
});
That will help to call global error handler.

Bump version of js-yaml

I noticed that totoro-node uses an old version of js-yaml that carries with it 2 vulnerabilities.
Bumping the version to >=3.13.1 should fix it.

Impossible to create a GET and a POST on a same url ?

Hello

app.use('/', totoro.rain({
    1: {
        // COMMENTS
        deprecated: true,
        "/functions/getComments": {
            method: "POST",
            endpointImplementation: test
        },
        "/functions/setComment": {
            method: "POST",
            endpointImplementation: test
        }
    },
    2: {
        "/comments": {
            method: "GET",
            endpointImplementation: test
        },
        "/comments": {
            method: "POST",
            endpointImplementation: test
        }
    }
}));

It seems it impossible to do this, it will create only the V2 POST route ๐Ÿ˜ข

debug: Adding routes for API version 1
debug: Adding route 'POST /1/functions/getComments'
debug: Adding route 'POST /1/functions/setComment'
debug:
debug: Adding routes for API version 2
debug: Adding route 'POST /2/comments'

reverting to old implementation syntax for compatibility reasons

@lexod @melnele
Your PRs #4 removed the endpoint.apiVersion parameter from the implementation syntax.
Doing this would break previous applications therefore I am reverting to the old syntax for writing the implementation:

implementation = (apiVersion, req, res, next) => {
    // do something
};

Also, please README.md for further information.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.