2.2.99 • Published 7 years ago

meetznow-backend v2.2.99

Weekly downloads
1
License
ISC
Repository
-
Last release
7 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

7 years ago

2.2.98

7 years ago

2.2.96

7 years ago

2.2.95

7 years ago

2.2.94

7 years ago

2.2.93

7 years ago

2.2.92

7 years ago

2.2.91

7 years ago

2.2.90

7 years ago

2.2.89

7 years ago

2.2.88

7 years ago

2.2.87

7 years ago

2.2.86

7 years ago

2.2.85

7 years ago

2.2.84

7 years ago

2.2.83

7 years ago

2.2.82

7 years ago

2.2.81

7 years ago

2.2.80

7 years ago

2.2.79

7 years ago

2.2.78

7 years ago

2.2.77

7 years ago

2.2.76

7 years ago

2.2.75

7 years ago

2.2.74

7 years ago

2.2.73

7 years ago

2.2.72

7 years ago

2.2.71

7 years ago

2.2.70

7 years ago

2.2.69

7 years ago

2.2.67

7 years ago

2.2.66

7 years ago

2.2.65

7 years ago

2.2.64

7 years ago

2.2.63

7 years ago

2.2.62

7 years ago

2.2.61

7 years ago

2.2.60

7 years ago

2.2.59

7 years ago

2.2.58

7 years ago

2.2.57

7 years ago

2.2.56

7 years ago

2.2.55

7 years ago

2.2.54

7 years ago

2.2.53

7 years ago

2.2.52

7 years ago

2.2.51

7 years ago

2.2.50

7 years ago

2.2.49

7 years ago

2.2.48

7 years ago

2.2.47

7 years ago

2.2.46

7 years ago

2.2.45

7 years ago

2.2.44

7 years ago

2.2.43

7 years ago

2.2.42

7 years ago

2.2.41

7 years ago

2.2.40

7 years ago

2.2.39

7 years ago

2.2.38

7 years ago

2.2.37

7 years ago

2.2.36

7 years ago

2.2.35

7 years ago

2.2.34

7 years ago

2.2.33

7 years ago

2.2.32

7 years ago

2.2.31

7 years ago

2.2.30

7 years ago

2.2.29

7 years ago

2.2.28

7 years ago

2.2.27

7 years ago

2.2.26

7 years ago

2.2.25

7 years ago

2.2.24

7 years ago

2.2.23

7 years ago

2.2.22

7 years ago

2.2.21

7 years ago

2.2.20

7 years ago

2.2.19

7 years ago

2.2.18

7 years ago

2.2.17

7 years ago

2.2.16

7 years ago

2.2.15

7 years ago

2.2.14

7 years ago

2.2.13

7 years ago

2.2.12

7 years ago

2.2.11

7 years ago

2.2.10

7 years ago

2.2.9

7 years ago

2.2.8

7 years ago

2.2.7

7 years ago

2.2.6

7 years ago

2.2.5

7 years ago

2.2.4

7 years ago

2.2.3

7 years ago

2.2.2

7 years ago

2.2.1

7 years ago

2.2.0

7 years ago

2.1.4

7 years ago

2.1.3

7 years ago

2.1.2

7 years ago

2.1.1

7 years ago

2.1.0

7 years ago

2.0.10

7 years ago

2.0.9

7 years ago

2.0.8

7 years ago

2.0.7

7 years ago

2.0.6

7 years ago

2.0.5

7 years ago

2.0.4

7 years ago

2.0.3

7 years ago

2.0.2

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.7.7

7 years ago

1.7.6

7 years ago

1.7.5

7 years ago

1.7.4

7 years ago

1.7.3

7 years ago

1.7.2

7 years ago

1.7.1

7 years ago

1.7.0

7 years ago

1.6.0

7 years ago

1.5.0

7 years ago

1.3.0

7 years ago