Marvel Api Test
The Project consists of a static html page, showing a marvel universe hero's name, picture and description. Title and description of a random story with the chosen hero as the protagonist are displayed along with all the characters appearing in that story. Please note that most of the stories seem to lack a description.
$ npm install.
Stylesheets are located under /css and contain bootstrap css as well as a custom css file.
The Gruntfile.js is a configuration file for the grunt js build system.
The Dockerfile and the nginx.conf (nginx.conf taken from an online example) files are used by Docker to build the container.
Cloud hosted project
To simplify things I setup a Digital Ocean Account which allows me to host a docker machine running nginx to serve the static web content.
The content is served over 188.8.131.52:8080.
Install locally #1
- requires an npm installation and a web server implementation (apache, nginx, etc)
- clone or download source code from github
$ git clone https://github.com/noctric/marvel-api-test
- change into project directory and execute
$ npm install(optional)
- install grunt locally by executing
$ npm install grunt(optional)
- change into
/srcdirectory and execute
$ npm install
- finally change back into the project directory and execute
$ grunt dist, which will build the project for distribution (optional)
The points marked with optional are only necessary, if you wish to build the project yourself. Otherwise it will suffice if you just download it and serve it, as the build artifact has also been uploaded. (The reason behind this is partly because the github repo is linked to docker hub and automatically builds a new docker image with every pushed commit. For simplicity I only took a standard nginx image and copy the static files into the docker container while it is being built. See Dockerfile.)
Install locally #2 (using docker)
- clone the project
- change into the project directory and build the docker container
$ docker build -t <custom tag> .*
- run the docker container as daemon
$ docker run -d -p <port>:80 <custom tag>
*The Dockerfile is also available on DockerHub by the Tag michael1luis/marvel-api-test and can be downloaded via
$ docker pull michael1luis/marvel-api-test.
Please note that if you run the project somewhere else (other then local) the referrer has to be registered to the account belonging to the calling apikey (in this case mine).