Angular Series - Games Info App Demo
Games Info App built using Angular 11 utilizing a public API
To brush up the Angular and get started with Angular 11. To create a public API based App.
Yes, used angular-cli-ghpages
to deploy to Github directly.
- Create a repo in github, push your code to main branch.
- Do
npm run build
- Do
npm i angular-cli-ghpages
- Do
ng build --base-href "https://<github_username>.github.io/<project_name>"
- When the build is complete, make a copy of
dist/index.html
and name itdist/404.html
- Finally, Do
ngh --dir dist/<project_name>
- Goto your Github repo -> Settings -> Pages (Side Nav) -> Select source branch as
gh-pages
&root
and save - Try accessing the URL generated above that.
- Create an account in
https://rapidapi.com/accujazz/api/rawg-video-games-database/details
- Under RAWG Video Games Database page, find Endpoints Tab under which you can find the x-rapidapi-key & x-rapidapi-host to use in httpheaders
- Goto
https://rawg.io/apidocs
, create an account and get theAPI key
to use in params in httpheaders interceptors file.
Or you can directly goto https://rawg.io/apidocs
, create an account, get the API key
and use directly like below in service call:
${env.BASE_URL}/api/games?key=${env.KEY}
BASE_URL = 'https://api.rawg.io', KEY = <Your API Key>
Either way it works!
This project was generated with Angular CLI version 12.0.3.
Run ng serve
for a dev server. Navigate to http://localhost:4200/
. The app will automatically reload if you change any of the source files.
Run ng build
to build the project. The build artifacts will be stored in the dist/
directory.