- 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.
- Clone this repository:
git clone https://github.com/AntoJebi7/express-form-submission-app.git
- Navigate into the project directory:
cd express-form-submission-app
- Install dependencies:
npm install
-
Start the server:
npm start
-
Open your browser and navigate to:
http://localhost:3000
-
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.
- POST
/submit
- Body:
{ "street": "Maple Avenue", "pet": "Buddy" }
- Body:
- 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.