0.3.2 • Published 8 years ago

annotation-api v0.3.2

Weekly downloads
42
License
-
Repository
github
Last release
8 years ago

Documentation

Build Status Code Climate Test Coverage

Node.js routing using annotations

This module allows you, to define your routes with annotations instead of using nested callbacks and exports. It also provides a validator, to automatically validate incoming requests. You can use it with express framework. Otherwise you can use the custom (flat and fast) built-in web server.

Read the Changelog.

Annotations

Create a Route

Read more

/**
 * es6 example
 * @Method("route");
 * @Route("/somewhere");
 * @HTTP("POST");
 * @Append("MyTransferObject.class");
 * @Query({ ... });
 * @Security("is_authenticated");
 * @RedirectErrorHandler("/err");
 */
module.exports.route = (req, res) => {
    res.end('validated');
};

Installation

  • Clone this repository
  • Run npm install
  • Run npm start

Usage

var app = require('express')();
var api = require('annotation-api')(app);
api.setApiPrefix('/my-base-url');
api.generate(__dirname + '/actions/**/*.js', callback);
api.generate([ __dirname + '/my-file.js' ]);

Example

Can be found here

Doc-Builder

Create a documentation via CLI

Tests

Execute the tests, using npm test.

0.3.2

8 years ago

0.3.1

8 years ago

0.3.0

8 years ago

0.2.2

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago

0.0.6

9 years ago

0.0.5

9 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago