Skip to content

Linda-Hanson/Capstone-project-scissors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Capstone-Project-Scissors

Introduction

This repository contains code for a server-side application built with Node.js and Express.js. The code sets up a server that handles various routes related to user authentication, user management, and URL management. The code includes functionality to get URLs, shorten and set URLs, update URLs, and delete URLs.

Table of Contents

-- Installation -- Usage -- Configuration
-- API Endpoints
-- Contributing
-- License

Installation

  1. Clone the repository to your local machine:
git clone <repository_url>
  1. Install the required dependencies by running the following command in the project directory:
npm install
  1. Set up the necessary configuration by creating a .env file in the root directory of the project and providing the required environment variables.

#Usage

  1. Start the server by running the following command:
node server.js
  1. The server will start running on the specified port (default: 3000).
  2. The server exposes various API endpoints for user authentication, user management, and URL management.

Configuration

--Create a .env file in the root directory of the project and provide the following environment variables: -- PORT: The port on which the server will run.

API Endpoints

The server provides the following API endpoints:

Get URLs

Description: Retrieve URLs associated with a user.
-- Route: GET /api/urls
-- Access: Private
-- Request Query Parameters:
-- user (required): User ID or email
-- Response: JSON array of URLs

Shorten and Set URL with a Key

Description: Shorten a URL and associate it with a key for encryption.
-- Route: POST /api/urls/:key
-- Access: Private
-- Request Body Parameters:
url (required): Original URL
user (required): User ID or email
key (required): Key for encryption
--Response: JSON object of the created URL

Update URL

Description: Update an existing URL.
-- Route: PUT /api/goals
-- Access: Private
-- Request Parameters:
id (required): URL ID --Request Body: Updated URL data
-- Response: JSON object of the updated URL v

Contributing

Contributions are welcome! If you'd like to contribute to this project, please follow these steps:
1)Fork the repository
2) Create a new branch
3) Make your changes
4) Test your changes
5) Submit a pull request

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors