Skip to content

(for template uses) A simple Express.js app that handles form submissions using body-parser, logs request details with morgan, and serves static HTML files.The code included in this repository is partially/entirely taken from external sources for educational purposes. Full credit goes to the original authors.

Notifications You must be signed in to change notification settings

AntoJebi7/Express-Form-Submission-App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Express Form Submission App

This is a basic Express.js application that demonstrates how to handle form submissions using `body-parser`. The app includes middleware to log request details using `morgan` and serves a static HTML file for form input.

Features

  • Form Handling: Submits form data (street and pet name) using POST requests.
  • Request Logging: Logs request details to the console using morgan middleware.
  • Static File Serving: Serves an HTML form located in the public folder.

Installation

  1. Clone this repository:
    git clone https://github.com/AntoJebi7/express-form-submission-app.git
  2. Navigate into the project directory:
    cd express-form-submission-app
  3. Install dependencies:
    npm install

Usage

  1. Start the server:

    npm start
  2. Open your browser and navigate to:

    http://localhost:3000
    
  3. Fill out the form with a street name and pet name, and submit it. The app will log the submitted values and respond with a concatenation of the street and pet name.

Example Request

  • POST /submit
    • Body:
      {
        "street": "Maple Avenue",
        "pet": "Buddy"
      }

Technologies Used

  • Express.js - Fast, unopinionated, minimalist web framework for Node.js.
  • body-parser - Middleware for parsing incoming request bodies.
  • morgan - HTTP request logger middleware for Node.js.

About

(for template uses) A simple Express.js app that handles form submissions using body-parser, logs request details with morgan, and serves static HTML files.The code included in this repository is partially/entirely taken from external sources for educational purposes. Full credit goes to the original authors.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published