You will be adding a new feature to an existing website.
Make sense of the provided REST API endpoints and add new route(s) (navigation) to the website to visualize the data received from the API in any preferable manner.
Understand and get comfortable with the given website codebase
Make sense of the provided REST API
Use the REST API endpoints in the website to fetch data.
Add new route to the website. Route should be shown in the left navigation bar
Use that new route to visualize data fetched from the API. Use your design sense and imagination.
Prerequisite: Git, Nodejs version <= 14.18.1
Run the following commands to clone the website repository and start the development server.
# clone the project
git clone https://github.com/armour/vue-typescript-admin-template.git
# enter the project directory
cd vue-typescript-admin-template
# install dependency
npm install --legacy-peer-deps
# development
npm run serve
It should automatically launch the website at port 9527
You can learn more about the project structure and features of this website here.
Link to the REST API: Click here.
The REST API is open sourced and provided by RapidAPI
You can test the endpoint in their API playground and get comfortable with the data fetched. You can also get your API key and necessary headers from the playground code snippet.
One sample request (implemented with JavaScript axios) is shown below for reference:
const axios = require("axios");
const options = {
method: 'GET',
url: 'https://covid-193.p.rapidapi.com/countries',
headers: {
'X-RapidAPI-Key': 'abcde1234',
'X-RapidAPI-Host': 'covid-193.p.rapidapi.com'
}
};
axios.request(options).then(function (response) {
console.log(response.data);
}).catch(function (error) {
console.error(error);
});
In this request:
abcde1234https://covid-193.p.rapidapi.com/countriesSolution Link section.node-gyp error while running npm install.Answer: Please use node version <= 14.18.1 to support fibers in Windows OS.
Object is possibly 'undefined' error while running npm run serve.Answer: Please follow the link to solve the error.
Best wishes for the task. For any further query, feel free to mail at contact@tajirhas9.xyz