✏️ Added README

This commit is contained in:
2021-09-01 17:33:48 -07:00
parent 5a753c96a4
commit 038fbfdb04

View File

@@ -1,38 +1,15 @@
[![Moleculer](https://badgen.net/badge/Powered%20by/Moleculer/0e83cd)](https://moleculer.services)
# comicvine-service
This is a [Moleculer](https://moleculer.services/)-based microservices project. Generated with the [Moleculer CLI](https://moleculer.services/docs/0.14/moleculer-cli.html).
## Usage
Start the project with `npm run dev` command.
After starting, open the http://localhost:3000/ URL in your browser.
On the welcome page you can test the generated services via API Gateway and check the nodes & services.
This microservice houses [comicvine](http://comicvine.gamespot.com) related endpoints that are used
to fetch metadata for various reasons on [ThreeTwo!](https://github.com/rishighan/threetwo).
In the terminal, try the following commands:
- `nodes` - List all connected nodes.
- `actions` - List all registered service actions.
- `call greeter.hello` - Call the `greeter.hello` action.
- `call greeter.welcome --name John` - Call the `greeter.welcome` action with the `name` parameter.
## Local Development
1. Clone this repo
2. Run `npm i`
3. You should see the service spin up and a list of all the endpoints in the terminal
4. The service can be accessed through `http://localhost:3080/api/comicvine/*`
## Docker Instructions
## Services
- **api**: API Gateway services
- **greeter**: Sample service with `hello` and `welcome` actions.
## Useful links
* Moleculer website: https://moleculer.services/
* Moleculer Documentation: https://moleculer.services/docs/0.14/
## NPM scripts
- `npm run dev`: Start development mode (load all services locally with hot-reload & REPL)
- `npm run start`: Start production mode (set `SERVICES` env variable to load certain services)
- `npm run cli`: Start a CLI and connect to production. Don't forget to set production namespace with `--ns` argument in script
- `npm run lint`: Run ESLint
- `npm run ci`: Run continuous test mode with watching
- `npm test`: Run tests & generate coverage report
- `npm run dc:up`: Start the stack with Docker Compose
- `npm run dc:down`: Stop the stack with Docker Compose
1. Build the image using `docker build . -t frishi/threetwo-import-service`. Give it a hot minute.
2. Run it using `docker run -it frishi/threetwo-import-service