A simple petstore with an API
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
Nicolas Massé 204350bc0d add doc + pipeline 6 years ago
.gitignore first commit 6 years ago
Jenkinsfile add doc + pipeline 6 years ago
README.md add doc + pipeline 6 years ago
openapi-spec.yaml V1 6 years ago
package-lock.json implement CORS 6 years ago
package.json implement CORS 6 years ago
server.js remove trailing / 6 years ago

README.md

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://83aad0fd501707ebeca3ae03959bd4f7f35d4dba2c98b2f2008cc401fe235aff@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.

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