ag-api
v1.0.0
Published
API for Algorithms in Grok Project
Downloads
2
Readme
node-docker-heroku-cicd
A test repo for setting up CICD from a node application to be published on heroku
Install
npm install
Build
docker build . -t node-docker-heroku-cicd
Test
docker run -p 3000:3000 node-docker-heroku-cicd npm run test
Start
docker run -p 3000:3000 node-docker-heroku-cicd npm run start
Browse
go to [https://localhost:3001] for Swagger UI API documentation go to [https://localhost:3001/api-docs]
Stop
find container ID
docker ps
using container ID from previous command
docker stop <container ID>
Building the client
This project uses OpenAPI Generator to generate client code for the Algorithm API
There is a GitHub action configured to generate and publish this client to the NPM registry, if for some reason you need to do this manually follow the steps below.
Generate the client
npx openapi-generator-cli generate -g javascript --additional-properties=usePromises=true -o client -i ./src/public/api.json
this client can then be published to the NPM registry to be used by the UI, you will require an NPM account to publish
if you have not added your user credentials to local NPM yet you will need to do that first, follow the prompts after invoking the following
npm adduser
log into NPM registry
npm login
publish
npm publish
it is not possible to republish packages to the NPM registry, if you need to publish changes be sure to update the version according to semver rules, most likely you will just need to bump the patch version of the OpenAPI specification at /src/api.json