Skip to content

This is a TypeScript-based backend server using Express.js to handle form submissions.

Notifications You must be signed in to change notification settings

daulatojha17/FormBackendAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Form Backend API

This is a TypeScript-based backend server using Express.js to handle form submissions.

Setup

  1. Clone the repository:
git clone https://github.com/daulatojha17/FormBackendAPI.git
cd formBackend
  1. Install dependencies:
npm install
  1. Create a .env file
PORT=3000
CORS_ORIGIN=*
  1. Start the server
npm run dev

Endpoints

Ping

  • Endpoint: /ping
  • Method: GET
  • Description: Checks if the server is running.
  • Example: http://localhost:3000/ping

Submit Form

  • Endpoint: /submit
  • Method: POST
  • Description: Submits a form with parameters name, email, phone, github_link, stopwatch_time.
  • Example: http://localhost:3000/submit
  • Body: JSON format with fields:
    {
      "name": "John Doe",
      "email": "[email protected]",
      "phone": "123-456-7890",
      "github_link": "https://github.com/johndoe",
      "stopwatch_time": "1:30:00"
    }

Read Form Submission

  • Endpoint: /read
  • Method: GET
  • Description: Reads a form submission by index (0-indexed).
  • Example: http://localhost:3000/read?index=0

Edit Form Submission

  • Endpoint: /edit/:ind
  • Method: PUT
  • Description: Edits a form submission by index (0-indexed).
  • Example: http://localhost:3000/edit/0

Delete Form Submission

  • Endpoint: /delete/:ind
  • Method: DELETE
  • Description: Deletes a form submission by index (0-indexed).
  • Example: http://localhost:3000/delete/0

Search Form Submission by Email

About

This is a TypeScript-based backend server using Express.js to handle form submissions.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published