Skip to content

This application serves a webpage that allows users to search for information by sending a search query to the server. The code integrates with two external APIs to retrieve search results and generates dynamic HTML pages using the EJS templating engine.

Notifications You must be signed in to change notification settings

johnandreopoulos/Wikipedia-Searcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Wikipedia-Searcher (Summarizer)

explorer_iQ3Dcme7AR

Overview

This is a node.js code for a web server application built using the Express framework. The application serves a webpage that allows users to search for information by sending a search query to the server. The code integrates with two external APIs (Wikipedia and DuckDuckGo) to retrieve search results.

Features

  • A simple and clean user interface for searching information
  • Integration with two external APIs for retrieving search results
  • Dynamic HTML pages generated by the EJS templating engine
  • Error handling for invalid search queries

Menu

Installation

  1. Clone the repository git clone https://github.com/JohnAndreop/Wikipedia-Searcher.git
  2. Install the dependencies npm install

Usage

  1. Start the server npm start
  2. Open a web browser and go to http://localhost:3000
  3. Enter a search query and click the "Search" button

Code Structure

The code starts by requiring the necessary modules, including the Express framework and the Undici module, which is used to handle HTTP requests. The code then sets up the Express application by enabling JSON parsing and setting the view engine to EJS. The views folder, where the EJS templates are stored, is also set up.

The assets folder, where static files such as CSS and images are stored, is also set up and made available through the '/assets' endpoint.

The code sets up two endpoints for handling requests:

  • The '/' endpoint, which serves the index page of the application.
  • The '/search' endpoint, which is responsible for handling the search functionality.

Dependencies

  • express
  • path
  • undici
  • ejs

Technology Stack

  • Node.js
  • npm
  • Express
  • Undici
  • EJS

About

This application serves a webpage that allows users to search for information by sending a search query to the server. The code integrates with two external APIs to retrieve search results and generates dynamic HTML pages using the EJS templating engine.

Topics

Resources

Stars

Watchers

Forks