Skip to content

Instantly share code, notes, and snippets.

@Kazimazi
Created January 25, 2023 13:54
Show Gist options
  • Save Kazimazi/7bd2e62ec89df6e6194c11b2f84e5547 to your computer and use it in GitHub Desktop.
Save Kazimazi/7bd2e62ec89df6e6194c11b2f84e5547 to your computer and use it in GitHub Desktop.
### Create service
curl --request POST \
--url http://localhost:81/services \
--header 'Content-Type: application/json' \
--data '{
"name": "filmstuff_service",
"url": "http://backend-api:3000"
}'
### Create routes
# Create user
curl --request POST \
--url http://localhost:81/services/filmstuff_service/routes \
--header 'Content-Type: application/json' \
--data '{
"name": "create_user_route",
"methods": ["POST"],
"paths": [
"/user$"
],
"strip_path": false
}'
# Login
curl --request POST \
--url http://localhost:81/services/filmstuff_service/routes \
--header 'Content-Type: application/json' \
--data '{
"name": "login_route",
"methods": ["POST"],
"paths": [
"/user/login$"
],
"strip_path": false
}'
# Logout
curl --request POST \
--url http://localhost:81/services/filmstuff_service/routes \
--header 'Content-Type: application/json' \
--data '{
"name": "logout_route",
"methods": ["GET"],
"paths": [
"/user/logout$"
],
"strip_path": false
}'
# Query films
curl --request POST \
--url http://localhost:81/services/filmstuff_service/routes \
--header 'Content-Type: application/json' \
--data '{
"name": "query_films_route",
"methods": ["GET"],
"paths": [
"/film$"
],
"strip_path": false
}'
# Create film
curl --request POST \
--url http://localhost:81/services/filmstuff_service/routes \
--header 'Content-Type: application/json' \
--data '{
"name": "create_film_route",
"methods": ["POST"],
"paths": [
"/film$"
],
"strip_path": false
}'
# Film CRUD
curl --request POST \
--url http://localhost:81/services/filmstuff_service/routes \
--header 'Content-Type: application/json' \
--data '{
"name": "create_film_route",
"methods": ["GET", "PUT", "DELETE"],
"paths": [
"/film/\d+"
],
"strip_path": false
}'
curl --request POST \
--url http://localhost:81/services/filmstuff_service/routes \
--header 'Content-Type: application/json' \
--data '{
"name": "watchlist_route",
"methods": ["GET", "POST"],
"paths": [
"/watchlist$"
],
"strip_path": false
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment