# medisot-base-server

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

Latest version **1.1.0** (published 2020-05-05) · ISC license · 0 weekly downloads

## Install

```sh
npm install medisot-base-server
pnpm add medisot-base-server
yarn add medisot-base-server
bun add medisot-base-server
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2020-05-05 |
| First published | 2020-03-24 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 7 |
| Unpacked size | 18.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Aditya |
| Maintainers | aditya_patnaik |

## Links

- npm: https://www.npmjs.com/package/medisot-base-server
- npm.io page: https://npm.io/package/medisot-base-server

## Dependencies (7)

- [path](https://npm.io/package/path.md) ^0.12.7
- [morgan](https://npm.io/package/morgan.md) ^1.9.1
- [express](https://npm.io/package/express.md) ^4.17.1
- [inversify](https://npm.io/package/inversify.md) ^5.0.1
- [node-uuid](https://npm.io/package/node-uuid.md) ^1.4.8
- [@types/express](https://npm.io/package/@types/express.md) ^4.17.3
- [inversify-express-utils](https://npm.io/package/inversify-express-utils.md) ^6.3.2

## Recent versions

- 1.1.0 (latest) — 2020-05-05
- 1.0.1 — 2020-03-24
- 1.0.0 — 2020-03-24

## README

![](https://rockpasta.com/wp-content/uploads/2019/04/2019-04-07-23_14_40-paulmccartneybass-hashtag-on-Instagram-%E2%80%A2-Photos-and-Videos-595x409.png)<br/>
**PAUL**<br/>
 A handy base server for inversify based express applications.
 <br/><br/>
 **How to use**<br/>
 To use, create a new instance of the BaseServer by providing the necessary constructor arguments:<br/>
 ```
 let baseServer = new BaseServer(AppFactory, container, serverConfig);
 ```
 
 1. AppFactory: A function that returns the express app. e.g. <br/>
 ```
 const AppFactory = (app, cluster) => {
    app.get("*", (req: any, res: any) => {
        res.send("Please send a valid request");
    })

    app.listen(8080);

    return app;
}
 ```
 
 2. Containers: The inversify container used in the express app for DI. e.g. <br/>
 ```
let container = new Container();

container.bind<any>(HyperledgerClientTypes.Connection).toConstantValue(Connection);
 ```
 
 3. ServerConfig: A callback with a single argument(app) that adds various configurations to the app e.g. <br/>
 ```
 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()
```

---
_Source: https://npm.io/package/medisot-base-server · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
