# virtualservice-local

> virtual service local

Latest version **0.0.6** (published 2020-11-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install virtualservice-local
pnpm add virtualservice-local
yarn add virtualservice-local
bun add virtualservice-local
```

Provides the command `vs`.

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.6 |
| Published | 2020-11-14 |
| First published | 2019-07-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 21 |
| Unpacked size | 2.5 MB |
| Known vulnerabilities | 0 (+33 in 6 direct dependencies) |
| Install scripts | no |
| Author | Leonardo Olmi |
| Maintainers | leo.olmi |

## Links

- npm: https://www.npmjs.com/package/virtualservice-local
- Repository: https://github.com/leolmi/virtualservice-local
- Homepage: https://github.com/leolmi/virtualservice-local#readme
- Issues: https://github.com/leolmi/virtualservice-local/issues
- npm.io page: https://npm.io/package/virtualservice-local

## Dependencies (21)

- [q](https://npm.io/package/q.md) ^1.4.1
- [ejs](https://npm.io/package/ejs.md) 2.5.5
- [jszip](https://npm.io/package/jszip.md) ^3.1.5
- [yargs](https://npm.io/package/yargs.md) ^7.0.1
- [lodash](https://npm.io/package/lodash.md) ~4.17.4
- [moment](https://npm.io/package/moment.md) ^2.10.6
- [morgan](https://npm.io/package/morgan.md) ^1.9.1
- [express](https://npm.io/package/express.md) ^4.16.3
- [passport](https://npm.io/package/passport.md) ~0.2.0
- [nodemailer](https://npm.io/package/nodemailer.md) ^5.1.1
- [body-parser](https://npm.io/package/body-parser.md) ^1.18.3
- [compression](https://npm.io/package/compression.md) ^1.7.3
- [express-jwt](https://npm.io/package/express-jwt.md) ^5.3.1
- [errorhandler](https://npm.io/package/errorhandler.md) ~1.0.0
- [jsonwebtoken](https://npm.io/package/jsonwebtoken.md) ^8.3.0
- [cookie-parser](https://npm.io/package/cookie-parser.md) ^1.4.3
- [serve-favicon](https://npm.io/package/serve-favicon.md) ^2.5.0
- [passport-local](https://npm.io/package/passport-local.md) ~0.1.6
- [express-session](https://npm.io/package/express-session.md) ^1.15.6
- [method-override](https://npm.io/package/method-override.md) ~3.0.0
- [composable-middleware](https://npm.io/package/composable-middleware.md) ^0.3.0

## Recent versions

- 0.0.6 (latest) — 2020-11-14
- 0.0.5 — 2019-07-18
- 0.0.4 — 2019-07-18
- 0.0.3 — 2019-07-18
- 0.0.2 — 2019-07-17
- 0.0.1 — 2019-07-17

## README

# Virtual Service offline

During the development of web applications the backend and the frontend often rely on different groups.
So you need to create a common REST call definition agreement.

If the backend is developed first, utilities such as [swagger](https://swagger.io/) or [postman](https://www.postman.com/)
are probably sufficient for the subsequent development of the client.
        
When it is necessary to first define REST calls, [<b>virtual-service</b>](https://virtualservice.herokuapp.com) becomes a practical solution.

With this tool you can run offline all serveices definited on on-line editor. 

## PREREQUISITES

- [nodejs](https://nodejs.org/it/)

## USE

- install virtualservice-local globally:
  ````
  $ npm i virtualservice-local -g
  ````

- download all service definitions you need from editor [https://virtualservice.herokuapp.com](https://virtualservice.herokuapp.com) and save files locally;
- run virtualservice-local serving files you need:
  ````
  $ vs "C:/local/path/file-downloaded-1.json" "C:/other/path/file-downloaded-2.json"
  ````

## OPTIONS
  ````
  $ vs [<options>] <files>
  ````
  options:
  
  `-p, --port` defines the port on which the server will be published (default=9010) <br>
  `--ip` defines the ip on which the server will be published (default=localhost) <br>
  

## SAMPLE

Suppose you download file `my-service-test.json` in a local path. So you can start virtual-service offline so:
````
$ vs "./my/local/path/my-service-test.json"
````

now your service is running on `http:localhost/9010` (9010 is default port) and you can call its methods:

````
http://localhost:9010/service/my-service/call/...
````

The same online call would have been:

````
https://virtualservice.herokuapp.com/service/my-service/call/...
````

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