npm.io
2.0.8 • Published 7 years ago

@shoio/server

Licence
MIT
Version
2.0.8
Deps
4
Size
23 kB
Vulns
0
Weekly
0

Shoio Server

Installing

npm install --save @shoio/core @shoio/server

Getting Started

import { Shoio } from "@shoio/core";
import { ShoioHttpServer } from "@shoio/server";

class PingService extends Shoio {

    mountRouter(http) {
        http.get('ping', this.ping)
    }

    routerMounted( server, config ) {
        console.log( 'Server running in port', config.port )
    }

    ping() {
        return 'pong'
    }

}

const app = new PingService({
    plugins: [
        new ShoioHttpServer({boot: true})  
    ]
})

app.mount()