2.2.99 • Published 6 years ago

meetznow-backend v2.2.99

Weekly downloads
1
License
ISC
Repository
-
Last release
6 years ago

Backend Package

Classes

MeetznowService

The Class is the base structure of every Service in our Backend. All Service Names are defined in src\Service.ts. A Service provides you with the Server and a Logger.

  • new Service(serviceName : Service)
    Constructor returns a Service but does not start it. The Service Name are defined in src/Services

  • start(service : Service) : Promise
    Static function to start the Service.

  • Service.getLogger(namespace? : string)
    Returns a new Logger with given Namespace

  • Service.addHandler <RequestPayload extends BaseRequestPayload, ResponsePayload extends BaseResponsePayload, RequestHandler extends Handler<RequestPayload, ResponsePayload>>(handler : RequestHandler)
    Adds a new Handler

Handler

Abstract Class to define the base Structure of our Handlers. The Handlers a used to define routes and what happens if they are accessed.

  • handle(data: Request, logger : Logger) : Promise<Response>
    given Function for all Handlers to handle the logging of request and surround the code where the request is processed to catch errors.

  • getHandlerName() : String
    Defines the Handler Name

  • getResult(data: Request) : Promise
    Abstract class to process the request.

Logger

Class that handles the Logging. The logs will be shown in the console of the service and send to Discord.

  • Logger.apiRequest(request : Request, response : Response,handlerName:String)
    Logs a complete Request with Response to the apiRequest channel.
  • Logger.request(request : Request, response : Response,handlerName:String)
    Logs a complete Request with Response to the Request channel.

The Following Calls are all logging the data you insert in the category and Channel that correspond with their name

  • Logger.info(id : ApiCallID, msg : string, ...optionalParams: any[])
  • Logger.debug(id : ApiCallID, msg : string, ...optionalParams: any[])
  • Logger.warn(id : ApiCallID, msg : string, ...optionalParams: any[])
  • Logger.error(id : ApiCallID, msg : string, ...optionalParams: any[])
  • Logger.fatal(id : ApiCallID, msg : string, ...optionalParams: any[])

Build New Service

To build a new Service you first have to add a new Service in the Service.ts file. Then you can start a new Node.js Project and add this Package. Then you include the Service and start it as described above.

2.2.99

6 years ago

2.2.98

6 years ago

2.2.96

6 years ago

2.2.95

6 years ago

2.2.94

6 years ago

2.2.93

6 years ago

2.2.92

6 years ago

2.2.91

6 years ago

2.2.90

6 years ago

2.2.89

6 years ago

2.2.88

6 years ago

2.2.87

6 years ago

2.2.86

6 years ago

2.2.85

6 years ago

2.2.84

6 years ago

2.2.83

6 years ago

2.2.82

6 years ago

2.2.81

6 years ago

2.2.80

6 years ago

2.2.79

6 years ago

2.2.78

6 years ago

2.2.77

6 years ago

2.2.76

6 years ago

2.2.75

6 years ago

2.2.74

6 years ago

2.2.73

6 years ago

2.2.72

6 years ago

2.2.71

6 years ago

2.2.70

6 years ago

2.2.69

6 years ago

2.2.67

6 years ago

2.2.66

6 years ago

2.2.65

6 years ago

2.2.64

6 years ago

2.2.63

6 years ago

2.2.62

6 years ago

2.2.61

6 years ago

2.2.60

6 years ago

2.2.59

6 years ago

2.2.58

6 years ago

2.2.57

6 years ago

2.2.56

6 years ago

2.2.55

6 years ago

2.2.54

6 years ago

2.2.53

6 years ago

2.2.52

6 years ago

2.2.51

6 years ago

2.2.50

6 years ago

2.2.49

6 years ago

2.2.48

6 years ago

2.2.47

6 years ago

2.2.46

6 years ago

2.2.45

6 years ago

2.2.44

6 years ago

2.2.43

6 years ago

2.2.42

6 years ago

2.2.41

6 years ago

2.2.40

6 years ago

2.2.39

6 years ago

2.2.38

6 years ago

2.2.37

6 years ago

2.2.36

6 years ago

2.2.35

6 years ago

2.2.34

6 years ago

2.2.33

6 years ago

2.2.32

6 years ago

2.2.31

6 years ago

2.2.30

6 years ago

2.2.29

6 years ago

2.2.28

6 years ago

2.2.27

6 years ago

2.2.26

6 years ago

2.2.25

6 years ago

2.2.24

6 years ago

2.2.23

6 years ago

2.2.22

6 years ago

2.2.21

6 years ago

2.2.20

6 years ago

2.2.19

6 years ago

2.2.18

6 years ago

2.2.17

6 years ago

2.2.16

6 years ago

2.2.15

6 years ago

2.2.14

6 years ago

2.2.13

6 years ago

2.2.12

6 years ago

2.2.11

6 years ago

2.2.10

6 years ago

2.2.9

6 years ago

2.2.8

6 years ago

2.2.7

6 years ago

2.2.6

6 years ago

2.2.5

6 years ago

2.2.4

6 years ago

2.2.3

6 years ago

2.2.2

6 years ago

2.2.1

6 years ago

2.2.0

6 years ago

2.1.4

6 years ago

2.1.3

6 years ago

2.1.2

6 years ago

2.1.1

6 years ago

2.1.0

6 years ago

2.0.10

6 years ago

2.0.9

6 years ago

2.0.8

6 years ago

2.0.7

6 years ago

2.0.6

6 years ago

2.0.5

6 years ago

2.0.4

6 years ago

2.0.3

6 years ago

2.0.2

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.7.7

6 years ago

1.7.6

6 years ago

1.7.5

6 years ago

1.7.4

6 years ago

1.7.3

6 years ago

1.7.2

6 years ago

1.7.1

6 years ago

1.7.0

6 years ago

1.6.0

6 years ago

1.5.0

6 years ago

1.3.0

6 years ago