How to use @phenyl/rest-api - 1 common examples

To help you get started, we’ve selected a few @phenyl/rest-api examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github phenyl / phenyl / modules / api-explorer / examples / index.ts View on Github external
memoryClient.insertOne({
  entityName: "patient",
  value: {
    name: "hoge",
    email: "hoge@cureapp.jp",
    password: crypt("hoge")
  }
});

memoryClient.insertOne({
  entityName: "hospital",
  value: { name: "hoge hospital" }
});

const server = new PhenylHttpServer(http.createServer(), {
  restApiHandler: new PhenylRestApi(functionalGroup, {
    // @ts-ignore TODO
    client: memoryClient,
    sessionClient: memoryClient.createSessionClient() as KvsClient<
      Session<"patient", MemberSessionValue>
    >
  }),
  customRequestHandler: new PhenylApiExplorer(functionalGroup, {
    path: "/explorer"
  }).handler
});

server.listen(PORT);
console.log(`server is listening on :${PORT}`);

@phenyl/rest-api

REST API logic. Core part of Phenyl.

Apache-2.0
Latest version published 2 years ago

Package Health Score

57 / 100
Full package analysis

Popular @phenyl/rest-api functions