4.1.0 • Published 2 years ago

@phenyl/rest-api v4.1.0

Weekly downloads
206
License
Apache-2.0
Repository
github
Last release
2 years ago

@phenyl/rest-api

REST API logic. Core part of Phenyl.

example

Define a functionalGroup to create a PhenylRestApi instance. FunctionalGroup is implementation to notify Phenyl about the domain that we want to use. See here for how to set up an http server using PhenylRestApi instance. See here for how to create userDefinition and nonUserDefinition.

import {
  createEntityClient as createMongoDBClient,
  connect,
} from "@phenyl/mongodb";
import PhenylRestApi from "@phenyl/rest-api";

const connection = await connect({
  url: "mongodb://localhost:27017",
  dbname: "mydb",
});

const entityClient = createEntityClient(connection);
const sessionClient = entityClient.createSessionClient();

class NonUserDefinition {
  constructor() {}
}

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

const restApiHandler = new PhenylRestApi(functionalGroup, {
  entityClient,
  sessionClient,
});
4.1.0

2 years ago

4.0.3

3 years ago

4.0.2

3 years ago

4.0.1

4 years ago

4.0.0

4 years ago

3.0.0

4 years ago

2.1.0

4 years ago

2.0.2

4 years ago

1.2.0

4 years ago

2.0.0

4 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

1.0.0-alpha.18

5 years ago

1.0.0-alpha.17

5 years ago

1.0.0-alpha.16

5 years ago

1.0.0-alpha.15

5 years ago

1.0.0-alpha.14

5 years ago

1.0.0-alpha.8

5 years ago

1.0.0-alpha.7

5 years ago

1.0.0-alpha.6

5 years ago

1.0.0-alpha.5

5 years ago

1.0.0-alpha.4

5 years ago

1.0.0-alpha.3

5 years ago

1.0.0-alpha.0

5 years ago