Skip to content
This repository has been archived by the owner on Jun 29, 2024. It is now read-only.

Latest commit

 

History

History
90 lines (63 loc) · 2.28 KB

readme.md

File metadata and controls

90 lines (63 loc) · 2.28 KB

marvel-moving

mrvl4.png

mrvl.png

mrvl2.png

mrvl3.png

mrvl-web

(2022) Browse and manage your favourite Marvel Comics. ReactJS 18.

Installation

cp .env.example .env
npm install

Usage

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/

Code snippet

/** 
 * 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
}

Misc

See MRVL Desktop.

Each Marvel API key (see environment variables) has a request limit of 3000/day.

See ReactJS Boilerplate.

See PHP Scraper.

See NodeJS ReactJS Boilerplate.

See PHP ReactJS Boilerplate.

Contributing

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.

License

BSD