Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

medisot-base-server

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

medisot-base-server

Helps create an inversify express application that utilises all the cores of the CPU

  • 1.0.0
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source


PAUL
A handy base server for inversify based express applications.

How to use
To use, create a new instance of the BaseServer by providing the necessary constructor arguments:

let baseServer = new BaseServer(AppFactory, container, serverConfig);
  1. AppFactory: A function that returns the express app. e.g.
const AppFactory = (app, cluster) => {
   app.get("*", (req: any, res: any) => {
       res.send("Please send a valid request");
   })

   app.listen(8080);

   return app;
}
  1. Containers: The inversify container used in the express app for DI. e.g.
let container = new Container();

container.bind<any>(HyperledgerClientTypes.Connection).toConstantValue(Connection);
  1. ServerConfig: A callback with a single argument(app) that adds various configurations to the app e.g.
const config = (app)  => {
   // app configurations
   app.use(bodyParser.json())
   app.use(bodyParser.urlencoded({ extended: true }))
   app.use(cookieParser())
}

After initializing the BaseServer, call the run method to start the application.

baseServer.run()

FAQs

Package last updated on 24 Mar 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc