0.0.2 • Published 8 years ago

webhost-api v0.0.2

Weekly downloads
2
License
ISC
Repository
github
Last release
8 years ago

webhost-api

A Api implemantation for WebHost.

Write using TypeScript with Visual Studio Code.

import * as webhost from 'webhost';
import * as api from 'webhost-api';

var server = new webhost.Server({
    rootApp: __dirname,
    wwwroot: __dirname + '/wwwroot'
});

server.configureServices((services): void => {

    api.addServices(services, {
        routes: [{
            name: 'default',
            pattern: 'api/{controller}/{action}'
        }]
    });

});

server.configure((app) => {
    
    app.use(api.Api);

    app.useErrorNotFound();

});

server.listen(1338);

Installation

$ npm install webhost-api

Features

  • Lightweight

Docs

Quick Start

Create a empty NPM package:

$ npm init -y

Install the typings for node:

$ typings install dt~node --global

Install WebHost:

$ npm install webhost --save
$ npm install webhost-api --save 

Work with code:

$ code .

Example

https://github.com/Cliveburr/WebHost/tree/master/Examples/SimpleApi
0.0.2

8 years ago

0.0.1

8 years ago