Optional
serverOptions: Nilable<ICreateServerOptions>Custom options.
The new instance.
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
Creates a new instance of a HTTP server.