0.1.6 • Published 8 years ago

bianca-server v0.1.6

Weekly downloads
-
License
MIT
Repository
bitbucket
Last release
8 years ago

BiancaJS, your new partner for your REST web server

Provide a safe and easy to use architecture for building RESTful nodejs applications.

It also allows to create full website backends:

  • static pages
  • dynamic pages, as well

logo bianca

What's this?

RESTful API

  • URI (Uniform resource identifier) as resources identifiers
  • HTTP verbs as operations identifiers
    • classical ones: GET,POST,PUT,DELETE
    • extra cool features: OPTION,HEAD
  • HTTP response codes as resources representations
  • link as relationship between resources (not fully implemented yet)
  • authentification token (not fully implemented yet)

Static pages

It simply forward a staic file from the file system to the user without any transformation.

Dynamic pages

According to some patterns you defined, it transforms a static file from the file system.

Then it sends the transformed stream to the user.

Router

We handle your requests and will route them for you to the right service. See schema below : Route

Features

  • easily editable and scalable
  • includes a ready-to-use mysql connector
  • configuration file for databases settings
  • configuration file for BiancaJS
  • logs file to maintain your application

Team

Under the hood

Schema bianca

Static pages

Store your local resources such as HTML web pages or files that are free to be accessed by users

Dynamic pages

Store your templates which can be dynamicaly edited by your server to render any pages you need.

Web service

Handle different kinds of HTTP requests to access databases or file server management.

this.doHead = function(p_httpUrl, p_body, p_responseWriterCallback) {
  p_responseWriterCallback(201, "No content", "text/html", "");
  // p_responseWriterCallback(404, "Not found", "text/html", "I'm sorry, I can't find anything for you.");
}

Will return a 201 HTTP code if you ask for a head request: HEAD http://localhost:8080/ws/v1/user

Technologies

  • NodeJS

Installing

npm init
npm install --save bianca-server

How to...

Include the bianca kernel into your project

var BiancaModule = require('bianca-server') 
var Bianca = new BiancaModule(); 

Start your server with the init function

Bianca.init(); 

Include new services

Write your own services into business/version folder and simply add it into the conf/services.json file.
You'll find an example of a service into business/v1/user.js file

{
  "name" :"sample user service",
  "description":"Example service for good usage",
  "author":"Bernard",
  "version":"v1",
  "service":"../business/v1/user.js"
}

Implement new services

this.doHead = function(p_response,p_httpUrl,p_body,callback)
this.doPost = function(p_response,p_httpUrl,p_body,callback)
this.doGet = function(p_response,p_httpUrl,p_body,callback)
this.doDelete = function(p_response,p_httpUrl,p_body,callback)
this.doPut = function(p_response,p_httpUrl,p_body,callback)
this.doOptions = function(p_response,p_httpUrl,p_body,callback)

Dependencies

  • http
  • colors
  • mysql

What's next?

Upcoming features

  • include a mongoDB connector to easily manage your NoSQL databases into your backend project
  • authentification token
  • service creation automation
  • http headers extraction from queries
0.1.6

8 years ago

0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago