0.13.14 • Published 6 years ago

airborne v0.13.14

Weekly downloads
8
License
MIT
Repository
github
Last release
6 years ago

Airborne API

Build Status npm version Codecov

Why do I need it?

Actually you don't. Really. I build this framework strictly in educational purpose and now I'm trying to use it on my projects. It's updated almost every day. Young and unstable. It's even not 1.x! Every day I write tests and add new features. After testing a lot of frameworks on NodeJS for my needs (all of them are using MV) I decided to write my own.

I advise you to use some of the mature frameworks (HAPI, Meteor etc).

If you decided to poke this stuff you can drop me a line

NodeJS support

Framework is written on ES6 and with help of babel compiled to ES5. So it supports node >= 4.1.2.

Contents

How it works

It uses DAO architecture and DI for its carcass.

Using Express server routing it get all request and processes to Dispatcher. Dispatcher parses url into segments and apllies call to Controller's method.

Example:

GET /messages // MessagesController.load()
GET /messages/1 // MessagesController.get(id)
POST /messages // MessagesController.create(payload)

Also you can divide controllers by Modules. Engine will parse your url and process like this:

GET /todo/tasks // Todo/TasksController.load()

REQUEST params

They will arrive in method in params argument

GET /messages/1/?limit=100 // MessagesController.get(id, params)

Controllers

Engine will search for controllers in controllers folder or you can create modules. In that case you have to place in module folder. More about Controllers

App controllers

/app
  controllers
    IndexController.js

By module

/app
  modules
    Todo
      controllers
        TasksController.js

Config

You can provide your own config that will replace default

module.exports = {
  path: './',
  host: 'localhost', // API host to run
  port: 3000, // API port
  debug: true,

  // Database section
  // Available mappers: MySQL (MariaDB) / Redis / MongoDB
  db :{

    mysql: { // Name of the connection
      // Connection details in Databases section
    }
  }
}

Databases

MySQL

To enable MySQL support you need to provide in config connection information:

db: {
  ...
  mysql: { // Name of the connection
    host: '127.0.0.1',  // by default
    port: 3306,         // by default
    username: 'root',   // by default
    password: 'myPassword1', // by default - using password: NO
    database: 'MyDatabase' // no defaults
  }
}

Redis

db: {
  ...
  myRedis: { // Name of the connection
    host: '127.0.0.1',        // by default
    port: 6379,               // by default
    username: 'root',         // by default no user
    password: 'myPassword1'   // by default - using password: NO
  }
}

MongoDB

db: {
  ...
  myMongo: { // Name of the connection
    host: '127.0.0.1',        // by default
    port: 27017,              // by default
    username: 'root',         // by default no user
    password: 'myPassword1'   // by default - using password: NO
  }
}
0.13.14

6 years ago

0.13.13

6 years ago

0.13.12

6 years ago

0.13.11

6 years ago

0.13.10

6 years ago

0.13.9

6 years ago

0.13.8

6 years ago

0.13.7

6 years ago

0.13.6

6 years ago

0.13.5

6 years ago

0.13.4

6 years ago

0.13.3

6 years ago

0.13.2

6 years ago

0.13.1

6 years ago

0.13.0

6 years ago

0.12.1

7 years ago

0.12.0

7 years ago

0.11.7

7 years ago

0.11.6

7 years ago

0.11.5

7 years ago

0.11.4

7 years ago

0.11.3

7 years ago

0.11.2

7 years ago

0.11.1

7 years ago

0.11.0

7 years ago

0.10.0

7 years ago

0.9.1

7 years ago

0.9.0

7 years ago

0.8.1

8 years ago

0.8.0

8 years ago

0.7.1

8 years ago

0.7.0

8 years ago

0.6.8

8 years ago

0.6.7

8 years ago

0.6.6

8 years ago

0.6.5

8 years ago

0.6.4

8 years ago

0.6.3

8 years ago

0.6.2

8 years ago

0.6.1

8 years ago

0.6.0

8 years ago

0.5.16

8 years ago

0.5.15

8 years ago

0.5.13

8 years ago

0.5.12

8 years ago

0.5.11

8 years ago

0.5.10

8 years ago

0.5.9

8 years ago

0.5.8

8 years ago

0.5.7

8 years ago

0.5.6

8 years ago

0.5.5

8 years ago

0.5.3

8 years ago