2.2.99 • Published 8 years ago

meetznow-backend v2.2.99

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

8 years ago

2.2.98

8 years ago

2.2.96

8 years ago

2.2.95

8 years ago

2.2.94

8 years ago

2.2.93

8 years ago

2.2.92

8 years ago

2.2.91

8 years ago

2.2.90

8 years ago

2.2.89

8 years ago

2.2.88

8 years ago

2.2.87

8 years ago

2.2.86

8 years ago

2.2.85

8 years ago

2.2.84

8 years ago

2.2.83

8 years ago

2.2.82

8 years ago

2.2.81

8 years ago

2.2.80

8 years ago

2.2.79

8 years ago

2.2.78

8 years ago

2.2.77

8 years ago

2.2.76

8 years ago

2.2.75

8 years ago

2.2.74

8 years ago

2.2.73

8 years ago

2.2.72

8 years ago

2.2.71

8 years ago

2.2.70

8 years ago

2.2.69

8 years ago

2.2.67

8 years ago

2.2.66

8 years ago

2.2.65

8 years ago

2.2.64

8 years ago

2.2.63

8 years ago

2.2.62

8 years ago

2.2.61

8 years ago

2.2.60

8 years ago

2.2.59

8 years ago

2.2.58

8 years ago

2.2.57

8 years ago

2.2.56

8 years ago

2.2.55

8 years ago

2.2.54

8 years ago

2.2.53

8 years ago

2.2.52

8 years ago

2.2.51

8 years ago

2.2.50

8 years ago

2.2.49

8 years ago

2.2.48

8 years ago

2.2.47

8 years ago

2.2.46

8 years ago

2.2.45

8 years ago

2.2.44

8 years ago

2.2.43

8 years ago

2.2.42

8 years ago

2.2.41

8 years ago

2.2.40

8 years ago

2.2.39

8 years ago

2.2.38

8 years ago

2.2.37

8 years ago

2.2.36

8 years ago

2.2.35

8 years ago

2.2.34

8 years ago

2.2.33

8 years ago

2.2.32

8 years ago

2.2.31

8 years ago

2.2.30

8 years ago

2.2.29

8 years ago

2.2.28

8 years ago

2.2.27

8 years ago

2.2.26

8 years ago

2.2.25

8 years ago

2.2.24

8 years ago

2.2.23

8 years ago

2.2.22

8 years ago

2.2.21

8 years ago

2.2.20

8 years ago

2.2.19

8 years ago

2.2.18

8 years ago

2.2.17

8 years ago

2.2.16

8 years ago

2.2.15

8 years ago

2.2.14

8 years ago

2.2.13

8 years ago

2.2.12

8 years ago

2.2.11

8 years ago

2.2.10

8 years ago

2.2.9

8 years ago

2.2.8

8 years ago

2.2.7

8 years ago

2.2.6

8 years ago

2.2.5

8 years ago

2.2.4

8 years ago

2.2.3

8 years ago

2.2.2

8 years ago

2.2.1

8 years ago

2.2.0

8 years ago

2.1.4

8 years ago

2.1.3

8 years ago

2.1.2

8 years ago

2.1.1

8 years ago

2.1.0

8 years ago

2.0.10

8 years ago

2.0.9

8 years ago

2.0.8

8 years ago

2.0.7

8 years ago

2.0.6

8 years ago

2.0.5

8 years ago

2.0.4

8 years ago

2.0.3

8 years ago

2.0.2

8 years ago

2.0.1

8 years ago

2.0.0

8 years ago

1.7.7

8 years ago

1.7.6

8 years ago

1.7.5

8 years ago

1.7.4

8 years ago

1.7.3

8 years ago

1.7.2

8 years ago

1.7.1

8 years ago

1.7.0

8 years ago

1.6.0

8 years ago

1.5.0

8 years ago

1.3.0

8 years ago