Skip to content

gdhardy1/attourl

Repository files navigation

Attourl

A url shortener service built with NestJS. Check out Attourl on Heroku.

About the Project

I used this project as a way to learn the NestJS framework. While the framework itself is overkill for a simple url shortener service, the project was involved enough to cover most of the framework's core features.

Learning Areas Covered

  • Modules, Controllers, Providers
  • Custom Providers
  • Dependency Injection
  • Middleware
  • Pipes
  • Configuration
  • Validation Pipes
  • Testing (End-to-End and Unit)
  • Serve Static
  • Mongoose

Technologies Used

  • TypeScript
  • Express
  • MongoDB + Mongoose
  • Jest + Supertest
  • Tailwind CSS



Documentation

Shorten Url

Retrieve Url



Shorten Url

URL: /api/url/shorten

Method: POST

Request

Body:

{ "longUrl": String (required) }

Response

Code: 201 Created

Body:

{
  "urlCode": "urlCode",
  "longUrl": "user submitted url",
  "shortUrl": "attourl.herokuapp.com/urlCode",
  "date": "date created"
}



Retrieve Url

URL: /:code

Method: GET

Parameters:

:code - urlCode returned from /api/url/shorten PUT

Response

Code: 302 Redirect

Redirects browser to retrieved url.



Code: 404 Not Found

Warns that url is not found.

About

A url shortener service built with NestJS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages