This repository contains the backend code for the secure-short application. The secure-short application is a tool for generating short links that can be password protected or not.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
Before you begin, make sure you have the following software installed on your computer:
- Git
- Node.js
- npm
Follow these steps to set up the project on your local machine:
- Clone the repository to your local machine:
git clone https://github.com/<your_username>/api-secure-short.git
- Change into the repository directory:
cd api-secure-short
- Install the required packages:
npm install
- Start the development server:
npm start
The backend should now be running on http://localhost:3000
.
The following endpoints are available in the API:
GET /links
: Retrieve a list of all links generated by the application.POST /links
: Create a new link. The request body should contain the following parameters:url
: The original URL that the short link should redirect to.password
(optional): A password that should be required to access the short link.
GET /links/:id
: Retrieve information about a specific link, specified by itsid
.PUT /links/:id
: Update a specific link, specified by itsid
. The request body should contain the parameters that should be updated.DELETE /links/:id
: Delete a specific link, specified by itsid
.
- Node.js - The backend framework used.
- Express.js - The web framework used for building the API.
- MongoDB - The database used for storing the links.
If you're interested in contributing to the project, please follow these guidelines:
- Fork the repository.
- Create a new branch for your changes.
- Make the changes and commits.
- Push the changes to your fork.
- Submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.