Git Product home page Git Product logo

vatican's Introduction

Vatican

NPM

Vatican attemps to be a micro-framework for creating APIs as quickly as possible. One of the key features of Vatican is the use of annotations on methods to define the endpoints of the API.

For a full code example of an app using Vatican, check out this repo: https://github.com/deleteman/vatican-example

Installing Vatican

$ npm install vatican

Running the tests

$ npm test

More info

Changelog

v 1.5.0

  • Added support for OPTIONS methods
  • Added endpoint versioning support
  • Added on-ready event, to avoid code referencing handler that haven't been parsed yet.
  • Added on-ready event for the database, this way, working with DB events and Vatican's events works the same way
  • Removed the need to start working with dbStart
  • Added SERVER-READY event, optional, if you want to be notified when the HTTP server is up and running

v 1.4.0

  • Added support for ES6 classes as resource handlers
  • Changed generator code to create ES6 compatible classes for resource handlers
  • Cleaned-up some code

v 1.3.2

  • Added close method on main server.
  • Fixed bug #30

v 1.3.1

  • Added new name attribute to @endpoint annotation
  • Added ability to set pre-processors on specific endpoints by name
  • Added model generator working with MongoDB
  • Auto generate handlers method's code based on their name
  • New generate syntax, allowing to specify attributes, types and http methods
  • Added index.js and package.json generator
  • Added tests to main components (Still needs more work)
  • Added removal of comments on handlers files, so now if you comment out an endpoint, it won't be parsed.
  • Improved handler parser regex
  • Improved general processing of handler file code.
  • Changed request parser to auto-parse content of PUT and POST requests into JSON (when possible)

v 1.2.4

  • Fixed bug causing incorrect parsing of post/put body content

v 1.2.3

  • Fixed bug preventing the handlers from loading installed modules using 'require'

v 1.2.2

  • Fixed bug causing problems with the pre-processing chain and the handler methods.

v 1.2.1

  • Fixed bug causing vatican to match incorrecly urls with similar templates
  • Changed preprocessing chain, so that now handler methods recieve the next function and can trigger the generic error handler functions

v 1.2.0

  • Fixed support for PUT requests
  • Added configuration overwrite on Vatican constructor and cli commands
  • Added callback function to start method of Vatican called after successful start of http server.
  • Updated cli help
  • Handlers are now stored in-memory after the first time they're loaded, so they're not loaded on every request.

v 1.1.0

  • Added pre-processor to request
  • Added post-processor to response
  • Fixed bug causing incorrect request parsing on non-post requests.

v 1.0.1

  • Changed default handler folder for create command
  • Minor readme fixes

v 1.0.0

  • Added create new project command
  • Minor fixes on readme

v 0.1.1

  • Added auto-stringify of objects passed to the send method on the response object.
  • Edited readme

v 0.0.1

  • First version

Contributing

If you feel like helping out by bug-fixing, or contributing with a new feature or whatever, just follow these simple steps:

  1. Create an issue for it.
  2. Fork the repo.
  3. Make your changes.
  4. Commit and create a pull request.
  5. Be happy :)

Contact me

If you have questions, or just want to send your love/hate, drop me an e-mail at: [email protected] Or visit my official site at www.fernandodoglio.com

License

The MIT License (MIT)

Copyright (c) 2013 Fernando Doglio

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

vatican's People

Contributors

bryant1410 avatar deleteman avatar smart--petea avatar

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.