@phenyl/http-server
TypeScript icon, indicating that this package has built-in type declarations

4.1.0 • Public • Published

@phenyl/http-server

Simple HTTP Server to host PhenylRestApi

example

To create a PhenylHttpServer instance, you need to create a PhenylRestApi instance.

import { createServer } from "http";
import PhenylHttpServer from "@phenyl/http-server";
import PhenylRestApi from "@phenyl/rest-api";
import { createEntityClient } from "@phenyl/memory-db";

const entityClient = createEntityClient();

class NonUserDefinition {
  constructor() {}
}

const functionalGroup = {
  nonUsers: { nonUser: new NonUserDefinition() },
  users: undefined,
  customQueries: undefined,
  customCommands: undefined,
};

const restApiHandler = new PhenylRestApi(functionalGroup, {
  entityClient,
  sessionClient: entityClient.createSessionClient(),
});

const server = new PhenylHttpServer(createServer(), { restApiHandler });

server.listen(8080)

/@phenyl/http-server/

    Package Sidebar

    Install

    npm i @phenyl/http-server

    Weekly Downloads

    4

    Version

    4.1.0

    License

    Apache-2.0

    Unpacked Size

    21.4 kB

    Total Files

    5

    Last publish

    Collaborators

    • shinout
    • naturalclar
    • sasurau4
    • wh1tecat
    • bowzstandard
    • alternacrow
    • camcam-lemon
    • 1natsu