• Creates a new instance of a HTTP server.

    Parameters

    Returns IHttpServer

    The new instance.

    Example

    import createServer, { json, IHttpRequest, IHttpResponse } from '@egomobile/http-server'

    const app = createServer()

    app.get('/', async (request: IHttpRequest, response: IHttpResponse) => {
    response.write('Hello!')
    // no response.end() needed here!
    })

    await app.listen(8181)
    console.log('HTTP server is running')

Generated using TypeDoc