0.0.2 • Published 8 years ago
webhost-api v0.0.2
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
- Github for Official Code
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