TinyApp is a full stack web application built with Node and Express that allows users to shorten long URLs (à la bit.ly).
- 🔗 TinyApp
- Table of Content
- 🌟 Features
- 🚀 Getting Started
- ⚫ Endpoints
- 🧱 Main Structure
- 📦 Tech Stack (Dependencies)
⚠️ Disclaimer
- Fork the repository.
- Install all dependencies using the
npm install
command. - Run the server using the
npm start
command. - Visit http://127.0.0.1:8080 or localhost:8080 in your browser (port defaults to 8080).
- Now you can register and start creating short URLs.
- Base URL : http://127.0.0.1:8080
Http method | path | Description |
---|---|---|
GET |
/ |
Gets index page and redirects to login page, unless logged in then to urls page |
GET |
/users |
Gets urls page if user is logged in, else redirects to login page |
GET |
/users/login |
Gets login page, unless logged in then redirects to urls page |
GET |
/users/logout |
Gets login page and sets session to null |
GET |
/users/register |
Gets registration page, unless logged in then redirects to urls page |
POST |
/users/login |
Verifies user credentials and if succesful starts a session |
POST |
/users/register |
Creates a new user, starts a session, and redirects to urls page |
GET |
/urls |
Gets urls index page and all the urls for the authorized user |
GET |
/urls/new |
Gets urls new page for the authorized user |
GET |
/urls/:id |
Gets urls show page for a specific url for the authorized user |
GET |
/u/:id |
Edits a card for a specific topic for the authorized user |
POST |
/urls |
Create a new short URL and redirect to the urls show page |
POST |
/urls/:id |
Edits a short URL for the authorized user |
POST |
/urls/:id/delete |
Delete a short URL for the authorized user |
├─── db # hardcoded database to hold user and url data
├─── helpers # helper functions
├─── routes # app routes
├─── test # helper functions tests
├─── views # EJS templates
│ ├── partials # EJS template partials
├─── .gitignore
├─── README.md
├─── package-lock.json
├─── package.json
└─── server.js # the server: the main driver of the app includes all the routes and server configs
- This is a project for LHL web development bootcamp and is not meant for production use.