Skip to content
Snippets Groups Projects
setup.sh 1.09 KiB
Newer Older
  • Learn to ignore specific revisions
  • meskio's avatar
    meskio committed
    #!/bin/sh
    
    TOKEN="$1"
    
    
    meskio's avatar
    meskio committed
    # 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
    
    # set up products
    
    meskio's avatar
    meskio committed
    curl -H "x-authentication: $TOKEN" -X "POST" -d '{"code": 234, "name": "aceite", "price": 1700, "stock": 35}' localhost:8080/api/product
    
    meskio's avatar
    meskio committed
    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