nmasse-itix / petstore-api

A simple petstore with an API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Petstore API

Setup

oc new-project petstore-api --display-name="Petstore API"
oc new-app openshift/nodejs~https://github.com/nmasse-itix/petstore-api.git
oc expose svc/petstore-api --hostname=petstore-api.app.itix.fr
3scale remote add -k 3scale-2.6 https://[REDACTED]@3scale-admin.3scale-ci-26.app.itix.fr/
oc create secret generic 3scale-toolbox -n "petstore-api" --from-file="$HOME/.3scalerc.yaml"

Configure your APIcast gateways to enable the CORS policy in the Global Policy Chain.

oc new-build --strategy=pipeline https://github.com/nmasse-itix/petstore-api.git -e PRIVATE_BASE_URL=http://petstore-api.app.itix.fr -e NAMESPACE=petstore-api -e TARGET_INSTANCE=3scale-2.6 -e SECRET_NAME=3scale-toolbox -e OIDC_ISSUER_ENDPOINT=https://3scale:[REDACTED]@sso.app.itix.fr/auth/realms/3scale-26 -e DISABLE_TLS_VALIDATION=yes -e MOCK_SERVER=https://microcks.app.itix.fr -e MOCK_URL=/rest/test/0.9.0

List all pets

curl http://localhost:8080/pets/

Get a pet

curl http://localhost:8080/pets/1
curl http://localhost:8080/pets/2

Create a pet

curl -XPOST http://localhost:8080/pets/ -H 'Content-Type: application/json' -d '{"name":"Raspoutine","tag":"dog"}'

Update a pet

curl -XPUT http://localhost:8080/pets/3 -H 'Content-Type: application/json' -d '{"id":3,"name":"Daisy","tag":"turtle"}'

Delete a pet

curl -XDELETE http://localhost:8080/pets/3

About

A simple petstore with an API


Languages

Language:JavaScript 100.0%