This project is a demonstration of web components, presented at the Orlando Codecamp. It uses the Marvel API to fetch and display data about Marvel characters.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
- Node.js and npm installed on your local development machine.
- A Marvel API key. You can get one from the Marvel Developer Portal.
- Clone the repository to your local machine:
git clone https://github.com/JavaVista/web-component-demo.git- Navigate into the project directory:
cd web-component-demo- Install the project dependencies:
npm install- Create a
.envfile in the root directory of the project and add your Marvel API keys:
PUBLIC_KEY=your_public_key
PRIVATE_KEY=your_private_keyRemember to replace your_public_key and your_private_key with your actual Marvel API keys.
- In your JavaScript file, import and configure dotenv to load the environment variables:
import dotenv from 'dotenv';
dotenv.config();- Start the development server:
npm startThe application should now be running at http://localhost:1234.
Enter a Marvel character's name in the search box and click the "Submit" button. The application will display information about the character. To search for a character, type the name in the input box and select a character from the autocomplete list. The details of the selected character will then be populated.
This project is licensed under the ISC License.
- Thanks to the Orlando Code Camp for the opportunity to present this project.
- Thanks to Marvel for providing the API.
