From fad4ff8c35a8c0fdeb3564e0527b93709eb3d222 Mon Sep 17 00:00:00 2001 From: meskio <meskio@sindominio.net> Date: Tue, 29 Sep 2020 17:02:02 +0200 Subject: [PATCH] Make address configurable on setup --- setup.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/setup.sh b/setup.sh index 54bc43c..1214cc9 100755 --- a/setup.sh +++ b/setup.sh @@ -1,14 +1,15 @@ #!/bin/sh TOKEN="$1" +ADDR="localhost:8080" # set up members -curl -H "x-authentication: $TOKEN" -X "POST" -d '{"num": 900, "name": "admin", "email": "admin@example.com", "password": "admin", "role": "admin", "balance": 10000}' localhost:8080/api/member -curl -H "x-authentication: $TOKEN" -X "POST" -d '{"num": 901, "name": "socia", "email": "socia@example.com", "password": "socia", "balance": 10000}' localhost:8080/api/member +curl -H "x-authentication: $TOKEN" -X "POST" -d '{"num": 900, "name": "admin", "email": "admin@example.com", "password": "admin", "role": "admin", "balance": 10000}' $ADDR/api/member +curl -H "x-authentication: $TOKEN" -X "POST" -d '{"num": 901, "name": "socia", "email": "socia@example.com", "password": "socia", "balance": 10000}' $ADDR/api/member # set up products -curl -H "x-authentication: $TOKEN" -X "POST" -d '{"code": 234, "name": "aceite", "price": 1700, "stock": 35}' localhost:8080/api/product -curl -H "x-authentication: $TOKEN" -X "POST" -d '{"code": 120, "name": "alubias", "price": 200, "stock": 60}' localhost:8080/api/product -curl -H "x-authentication: $TOKEN" -X "POST" -d '{"code": 302, "name": "esparragos", "price": 300, "stock": 45}' localhost:8080/api/product -curl -H "x-authentication: $TOKEN" -X "POST" -d '{"code": 320, "name": "limpia suelos", "price": 450, "stock": 40}' localhost:8080/api/product -curl -H "x-authentication: $TOKEN" -X "POST" -d '{"code": 112, "name": "arroz", "price": 120, "stock": 50}' localhost:8080/api/product +curl -H "x-authentication: $TOKEN" -X "POST" -d '{"code": 234, "name": "aceite", "price": 1700, "stock": 35}' $ADDR/api/product +curl -H "x-authentication: $TOKEN" -X "POST" -d '{"code": 120, "name": "alubias", "price": 200, "stock": 60}' $ADDR/api/product +curl -H "x-authentication: $TOKEN" -X "POST" -d '{"code": 302, "name": "esparragos", "price": 300, "stock": 45}' $ADDR/api/product +curl -H "x-authentication: $TOKEN" -X "POST" -d '{"code": 320, "name": "limpia suelos", "price": 450, "stock": 40}' $ADDR/api/product +curl -H "x-authentication: $TOKEN" -X "POST" -d '{"code": 112, "name": "arroz", "price": 120, "stock": 50}' $ADDR/api/product -- GitLab