/dawit

Primary LanguageJavaScript

Directory Overview

  • views/: Contains the HTML file for the web page.
  • controllers/: Contains the controller for data fetching logic.
  • routes/: Contains the API route definitions.
  • app.js: Main server setup.
  • package.json: Node.js project configuration.
  • README.md: Overview, purpose, and solution descriptions.

Purpose of Each Problem

  • Setting Up the Server and Basic Routing- to set up a basic Node.js server. It establishes a foundation for handling HTTP requests and routing within the application.
  • Creating a Route and Serving an HTML Page- to showcase your skills in setting up routes to render HTML content, providing a user-friendly interface for the web application.
  • Fetching and Rendering API Data on the Web Page- shows proficiency in manipulating the Document Object Model (DOM) and updating content dynamically.

Fetching and Displaying Data

  • public/index.html: Provides a simple web page layout.
  • controllers/dataController.js: Handles data fetching logic from a public API.
  • routes/api.js: Defines API routes for data retrieval.
  • server.js: Sets up the Express server and serves the web page.

Solutions Implemented

  • The web application fetches data from the JSONPlaceholder API using asynchronous HTTP requests.
  • The fetched data is displayed on the web page in styled cards.
  • Routes are organized using separate controller and route files.

Getting Started

  1. Clone this repository: git clone https://github.com/imalisusan/dawit-interview
  2. Navigate to the project directory: cd dawit
  3. Install dependencies: npm install
  4. Start the server: node ./bin/www
  5. Open your browser and visit: http://localhost:3000

License

This project is licensed under the MIT License - see the LICENSE file for details.