Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "server"

Index

Variables

Const PORT

PORT: 8080 = 8080

Const app

app: Express = express()

Node Js Express server that will handle the backend work for our service. The primary functionality is to recive a graphql post request and query the blockchain using graphql. The post function will pass on the request to 'graphql' which will carry out obtaining and rendering the query.

Const app_post_graphql_comment

app_post_graphql_comment: 0 = 0

Main entry point to the backend and database All requests will go through this and depending on type of request a different query will be carried out This post receives source,operationName,variableValues, and contextValue as parameters. Each of these parameters need to be in a particular format, and the client side will format them from given input.

param source is the query itself, what user is looking for

param operationName indicates which query will take place; which functions will be carried out

param variableValues are values required for certain queries; e.g. specify paritcular health descriptor

param contextValue is a custom object that specifies the user trying to access the data

Const server

server: Server = app.listen(PORT, () => {console.log(`Express server initialized on port ${PORT}`);console.log(`GraphQL requests are enabled on /graphql endpoint via POST requests`);})

Generated using TypeDoc