$ cd app
$ mkdir tickets
copy some files from auth project
$ npm install
$ skaffold dev
$ cd tickets
$ npm run test
$ cd common
$ npm run publish
$ cd tickets
$ npm update @grider-ms-tickets/common
// SIGN UP
$ curl \
--insecure \
--cookie-jar /tmp/cookies.txt \
--data '{"email":"[email protected]", "password":"123456789"}' \
--header "Content-Type: application/json" \
--request POST https://ticketing.dev/api/users/signup \
| python -m json.tool
// SIGN IN
$ curl \
--data '{"email":"[email protected]", "password":"123456789"}' \
--header "Content-Type: application/json" \
--request POST http://ticketing.dev/api/users/signin \
| python -m json.tool
// GET CURRENT USER
$ curl \
--insecure \
--cookie /tmp/cookies.txt \
--header "Content-Type: application/json" \
--request GET https://ticketing.dev/api/users/currentuser \
| python -m json.tool
// CREATE TICKET
$ curl \
--insecure \
--cookie /tmp/cookies.txt \
--data '{"title":"concert", "price":10}' \
--header "Content-Type: application/json" \
--request POST https://ticketing.dev/api/tickets \
| python -m json.tool
response:
{
"__v": 0,
"id": "5ebaa8a74cea0900186b7ec8",
"price": 10,
"title": "concert",
"userId": "5ebaa6a3fc342b0023ded8a4"
}
// GET TICKET
$ curl \
--insecure \
--header "Content-Type: application/json" \
--request GET https://ticketing.dev/api/tickets/5ebaa8a74cea0900186b7ec8 \
| python -m json.tool
response:
{
"__v": 0,
"id": "5ebaa8a74cea0900186b7ec8",
"price": 10,
"title": "concert",
"userId": "5ebaa6a3fc342b0023ded8a4"
}
// GET ALL TICKET
$ curl \
--insecure \
--header "Content-Type: application/json" \
--request GET https://ticketing.dev/api/tickets/ \
| python -m json.tool
// UPDATE TICKET
$ curl \
--insecure \
--cookie /tmp/cookies.txt \
--data '{"title":"new concert", "price":100}' \
--header "Content-Type: application/json" \
--request PUT https://ticketing.dev/api/tickets/5ebaa8a74cea0900186b7ec8 \
| python -m json.tool
Marley
Any questions in english: Telegram Chat
Любые вопросы на русском: Телеграм чат