(2022) Browse and manage your favourite Marvel Comics. ReactJS 18.
cp .env.example .env
npm install
Update https://github.com/kkamara/mrvl-web/blob/main/src/constants.jsx to the following:
// export const ENV = 'prod'
export const ENV = 'local'
Start the server:
npm start
# The app works at the following full path including trailing `/`.
# http://localhost:3000/mrvl-web/
/**
* Return searchable paginated characters api response
* @param {array} ids
* @return {Promise}
*/
async getFavComics(ids) {
const promises = []
let comics = []
for (const id of ids) {
promises.push(new Promise(async resolve => {
const comic = await this.getComic(id)
resolve(comic.data.data.results[0])
}))
}
await new Promise((resolve, reject) => {
Promise.all(promises).then(data =>
comics = data
resolve()
})
.catch(err => { throw err })
})
return comics
}
Each Marvel API key (see environment variables) has a request limit of 3000/day.
See NodeJS ReactJS Boilerplate.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.