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
$ npm install vatican
$ npm test
- Check out VaticanJS official documentation: https://www.fernandodoglio.com/vaticanjs-docs
- 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
- Added support for ES6 classes as resource handlers
- Changed generator code to create ES6 compatible classes for resource handlers
- Cleaned-up some code
- Added close method on main server.
- Fixed bug #30
- 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)
- Fixed bug causing incorrect parsing of post/put body content
- Fixed bug preventing the handlers from loading installed modules using 'require'
- Fixed bug causing problems with the pre-processing chain and the handler methods.
- 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
- 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.
- Added pre-processor to request
- Added post-processor to response
- Fixed bug causing incorrect request parsing on non-post requests.
- Changed default handler folder for create command
- Minor readme fixes
- Added create new project command
- Minor fixes on readme
- Added auto-stringify of objects passed to the send method on the response object.
- Edited readme
- First version
If you feel like helping out by bug-fixing, or contributing with a new feature or whatever, just follow these simple steps:
- Create an issue for it.
- Fork the repo.
- Make your changes.
- Commit and create a pull request.
- Be happy :)
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
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.