This repository contains the backend API implementation for storing submissions from the Desktop Form Application.
This backend API handles HTTP requests to store and retrieve submission data. It stores submissions in a JSON file and serves them over HTTP endpoints.
- Accepts POST requests to store new submissions.
- Provides GET requests to fetch all stored submissions.
- Node.js with Express.js for the API server.
- Body-parser for parsing JSON requests.
- fs (File System) module for reading and writing submissions to a JSON file.
- Node.js installed on your machine.
-
Clone the Repository
- Open your command line interface.
- Navigate to the directory where you want to clone the repository.
- Run the following command:
git clone https://github.com/Jainharshit09/submission-backend.git
- Navigate into the cloned repository:
cd submission-backend
-
Install Dependencies
- Run the following command to install the required dependencies:
npm install
- Run the following command to install the required dependencies:
- Start the Server
- Run the following command to start the server:
npm start
- The server will run on
http://localhost:8000
by default.
- Run the following command to start the server:
- POST /submit: Endpoint to submit new data.
- GET /readAll: Endpoint to retrieve all submissions.
- Submitting Data: Send a POST request to
/submit
with JSON data containingname
,email
,phone
,github_link
, andstopwatch_time
. - Fetching Data: Send a GET request to
/readAll
to retrieve all stored submissions.
- No known issues at this time.
Contributions are welcome. Please fork the repository, make changes, and submit a pull request. For major changes, please open an issue first to discuss what you would like to change.
- Thanks to Slidely for providing the opportunity to work on this task.