Good luck!
- Python 2.7
- Node.js > 6.9, with npm > 3.0.0
npm install
pip install -r requirements.txt
- (optional) run
pydevproject.py
to set up paths for pydev/eclipse
- `npm run test %API_KEY%
Comment by Johan: I had to add the API_KEY parameter to the test since it is needed to test the MovieFetcher
npm run backend
localhost:7070
as default
- backend should be running
localhost:7000
as default
- Python 2.7
- protorpc
- ndb
- Google AppEngine
- Datastore
To use MovieFetcher and the api, you need to do so by HTTP requests. I will here explain how to do this using curl. For any of these methods, just open a new terminal and enter the command as stated here.
curl -H \
'content-type:application/json' \
-d '{"api_key": "%VALUE%", "omdb_start_id": "%VALUE%", "nof_movies": "%VALUE%"}'\
http://localhost:7070/MovieFetcher.fetch
Fields:
api_key (string): required
omdb_start_id (string): not required
nof_movies (integer): not required
Returns:
Result string
curl -H \
'content-type:application/json' \
-d '{"title": "%VALUE%"}'\
http://localhost:7070/api.get_movie
Fields:
title (string): not required
Returns:
JSON-serializable string with movie data
curl -H \
'content-type:application/json' \
-d '{"nof_movies": "%VALUE%"}'\
http://localhost:7070/api.get_movie_list
Fields:
nof_movies (integer): not required
Returns:
List of strings i.e. movie titles
curl -H \
'content-type:application/json' \
-d '{"api_key": "%VALUE%", "title": "%VALUE%"}'\
http://localhost:7070/api.add_movie
Fields:
api_key (string): required
title (string): required
Returns:
Result string indicating how the operattion went
curl -H \
'content-type:application/json' \
-d '{"omdb_id": "%VALUE%"}'\
http://localhost:7070/api.delete_movie
Fields:
omdb_id (string): required
Returns:
Result string indicating how the operattion went
NOTE: There is no user authentication going on here. I did not have time to dig into all of that.