Skip to content

aleaguilar01/tinyapp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TinyApp

TinyApp is a collection of backend endpoints for managing URLs in a URL shortening service. It provides functionalities such as URL creation, editing, deletion, and user authentication.

Table of Contents

Dependencies

TinyApp Backend is built with Node.js and Express.js framework. It uses the following dependencies:

  • express: Fast, unopinionated, minimalist web framework for Node.js
  • cookie-session: Simple cookie-based session middleware
  • bcryptjs: Library to hash passwords
  • method-override: Middleware for overriding HTTP methods
  • ejs: Embedded JavaScript templating engine

Endpoints

The following are the main endpoints provided by TinyApp Backend:

  • GET /: Root endpoint. Redirects users to the login page if not logged in, otherwise redirects to the URLs index page.
  • GET /urls: Displays a list of URLs created by the logged-in user.
  • GET /urls/new: Renders a form to create a new URL.
  • GET /urls/:id: Displays details of a specific URL.
  • POST /urls: Creates a new URL.
  • PUT /urls/:id: Updates the URL with the specified ID.
  • DELETE /urls/:id/delete: Deletes the URL with the specified ID.
  • GET /register: Renders the registration page.
  • GET /login: Renders the login page.
  • POST /register: Registers a new user.
  • POST /login: Logs in an existing user.
  • POST /logout: Logs out the current user.
  • GET /u/:id: Redirects to the long URL associated with the specified short URL ID.

Strech

  • Method Override: Uses forms PUT and DELETE.
  • Analytics: Keeps track of when an URL was created, the number of unique visits, the vitis log and displays it on the edit page for the URL.

Installation

  1. Clone the repository: git clone https://github.com/aleaguilar01/tinyapp.git
  2. Install dependencies: npm install

Usage

  1. Start the server: npm start
  2. Open your web browser and navigate to http://localhost:8080
  3. Register a new account or log in with an existing account.
  4. Create, edit, or delete URLs as needed.

Final Product

"Screenshot of URLs page"

"Screenshot of edit page"

"Screenshot of create TinyURL page"

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvement, please open an issue or submit a pull request.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published