-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from angelo-v/3-create-a-new-movie
add a movies collection with the ability to create a new movie
- Loading branch information
Showing
6 changed files
with
104 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
APP ?= hydra-movies | ||
|
||
image: ## build image and push to heroku registry | ||
heroku container:push web --app hydra-movies | ||
heroku container:push web --app $(APP) | ||
|
||
release: ## release container to heroku | ||
heroku container:release web --app hydra-movies | ||
heroku container:release web --app $(APP) | ||
|
||
deploy: image release | ||
|
||
logs: ## show heroku logs | ||
heroku logs --tail --app hydra-movies | ||
heroku logs --tail --app $(APP) | ||
|
||
.PHONY: image release deploy logs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
{ | ||
"@context": { | ||
"hydra": "http://www.w3.org/ns/hydra/core#", | ||
"schema": "http://schema.org/" | ||
} | ||
} | ||
"@context": [ | ||
"https://www.w3.org/ns/hydra/core", | ||
{ | ||
"mov": "https://hydra-movies.herokuapp.com/doc#", | ||
"schema": "http://schema.org/" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,60 @@ | ||
{ | ||
"@context": "/context.jsonld", | ||
"@id": "/doc", | ||
"@type": "hydra:ApiDocumentation", | ||
"hydra:title": "Hydra Movies API", | ||
"hydra:description": "This API shows how a basic CRUD (Create, Read, Update, Delete) API can be designed using Hydra Core Vocabulary.", | ||
"hydra:entrypoint": "/", | ||
"hydra:supportedClass": [ | ||
"@type": "ApiDocumentation", | ||
"title": "Hydra Movies API", | ||
"description": "This API shows how a basic CRUD (Create, Read, Update, Delete) API can be designed using Hydra Core Vocabulary.", | ||
"entrypoint": "/", | ||
"supportedClass": [ | ||
{ | ||
"@id": "schema:EntryPoint", | ||
"@type": "Class", | ||
"title": "API entrypoint", | ||
"description": "Every capability of the API can be reached from here by following links." | ||
}, | ||
{ | ||
"@id": "mov:Movies", | ||
"@type": "Class", | ||
"title": "Movies", | ||
"description": "Allows to access and manage movies that are available via the API.", | ||
"supportedOperation": { | ||
"@id": "mov:create-movie", | ||
"@type": [ "Operation", "schema:CreateAction" ], | ||
"title": "Create movie", | ||
"description": "Creates a new movie", | ||
"method": "POST", | ||
"expects": "schema:Movie", | ||
"returns": "schema:Movie", | ||
"possibleStatus": [ | ||
{ | ||
"statusCode": 201, | ||
"description": "If the movie was created successfully." | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"@id": "schema:Movie", | ||
"@type": "hydra:Class", | ||
"hydra:title": "A movie" | ||
"@type": "Class", | ||
"title": "Movie", | ||
"description": "A single movie", | ||
"supportedProperty": [ | ||
{ | ||
"property": "schema:name", | ||
"title": "name", | ||
"description": "The movie's name" | ||
}, | ||
{ | ||
"property": "schema:description", | ||
"title": "description", | ||
"description": "Textual description of the movie." | ||
}, | ||
{ | ||
"property": "schema:duration", | ||
"title": "duration", | ||
"description": "The movie's duration in ISO 8601 date format." | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
{ | ||
"@context": "/context.jsonld", | ||
"@id": "/", | ||
"@type": "hydra:Entrypoint" | ||
} | ||
"@type": "schema:EntryPoint", | ||
"collection": { | ||
"@id": "movies", | ||
"@type": [ | ||
"Collection", | ||
"mov:Movies" | ||
] | ||
} | ||
} |