# tiny-srv

> A simple way to write micro-services.

Latest version **1.0.2** (published 2018-11-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install tiny-srv
pnpm add tiny-srv
yarn add tiny-srv
bun add tiny-srv
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2018-11-20 |
| First published | 2018-06-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Unpacked size | 5.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | J. Rasmussen |
| Maintainers | jrasmussen |

## Links

- npm: https://www.npmjs.com/package/tiny-srv
- npm.io page: https://npm.io/package/tiny-srv

## Dependencies (7)

- [cors](https://npm.io/package/cors.md) ^2.8.4
- [helmet](https://npm.io/package/helmet.md) ^3.12.1
- [express](https://npm.io/package/express.md) ^4.16.3
- [lumberr](https://npm.io/package/lumberr.md) ^2.0.2
- [body-parser](https://npm.io/package/body-parser.md) ^1.18.3
- [compression](https://npm.io/package/compression.md) ^1.7.2
- [cookie-parser](https://npm.io/package/cookie-parser.md) ^1.4.3

## Recent versions

- 1.0.2 (latest) — 2018-11-20
- 1.0.1 — 2018-06-17

## README

# tiny-srv

A simple way to write micro-services.

### Getting it running ~

fastest way to get a server running is with these two lines:

```javascript
const tiny = require('tiny-srv');
module.exports = tiny().catch(console.log);
```

### Configuring the server

This module returns a promise with the resolved express app object so you can easily hang your routes and middleware onto the app as needed after the module has been initialized. Now, there are a number of configurable options.

```javascript
const tiny = require('tiny-srv');	
module.exports = tiny({
	// defaults to either the environment variable PORT or 8080
    port: 3000
    /* If you wish to use an HTTPS server, you must also pass in a
     * certificate with the server, this should look like
     * certificate : { 
     * 	 certificate: <path to the file>, passphrase: <pass> 
     * }
     */
    enableHTTPS: false,
    /* any of these settings can be set by a boolean value */
    enableCORS: false,
    enableCompression: true,
    enableSecurity: true
})
```

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