Giter VIP home page Giter VIP logo

web-decorators's Issues

Child controllers

Find something to "mount" other controllers to a current controller, so the app would be a tree of Controller linking each other.

A PropertyDecorator might be used for that purpose.

Set response cookies

  • Add cookie attribute in ResponseMetadata
  • Make the express adapter to send the cookies

Error handlers

Add error handler in controllers ?

Maybe something like spring's controller advice ?

Create a default adapter without express

Use https://www.npmjs.com/package/route-parser for route matching, implement the concept of routes and middlewares.

  • Create the main handler function to give to http#createServer()
  • Create the structure that takes the methods and patterns
  • Create the api to add routes to the route container
  • On request, dispatch the request to the right handler, from the pattern and method
  • Extract path params from the request
  • Extract query string params from the request
  • Provide an API to read the request body
  • Add response related tasks
  • Add middleware related tasks

Response type handling

For the moment, the result is sent as is, it should be possible to force a return type.

Publish on npm

How to provide the typing information through an npm package ?

  • Create .npmignore file
  • Create a dist .d.ts type definition file
  • Normalize the public interface
  • Add express adapter in the public interface

Change how a controller is bootstrapped

A controller is bootstrapped (configured with the backend) when it is first encountered by the runtime.
It would be better if the @controller decorator did not contain the backend adapter, and use directly the adapter to add classes that must be parsed.

Moreover, with es6 or commonjs modules, all classes are not loaded at startup, so only adding a @controller alone would not have much effect.

@controller might be merged with @route.

Return value

We must inject the response with @ResParam to send content to the client, it would be better to return a result with a return statement, even an asynchronous result via Promise or thunk.

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.