Short URL Creation
+ +Example Creation:
+POST [project_url]/api/shorturl/new
- Body (URL encoded): url=https://www.google.com
Example Usage:
+ [project_url]/api/shorturl/3 +Will Redirect to:
+https://forum.freecodecamp.org/
+diff --git a/public/style.css b/public/style.css index f40d067..462a1bb 100644 --- a/public/style.css +++ b/public/style.css @@ -7,7 +7,7 @@ body { line-height: 1.4em; } -.container { +main { padding: 0; margin-top: 40px; } @@ -16,7 +16,7 @@ h3 { margin-top: 30px; } -.footer { +footer { margin-top: 40px; } @@ -54,8 +54,6 @@ a { } form { - border: solid 1px black; - border-radius: 5px; margin: 10px auto; padding: 20px; max-width: 600px; diff --git a/views/index.html b/views/index.html index 901de04..2bdbc0a 100644 --- a/views/index.html +++ b/views/index.html @@ -12,39 +12,30 @@
-POST
a URL to [project_url]/api/shorturl/new
and I will receive a shortened URL in the JSON
- response.{ "original_url": "www.google.com", "short_url": 1 }
- http(s)://www.example.com(/more/routes)
format,
- the JSON response will contain an error like { "error": "invalid URL" }
dns.lookup(host, cb)
from the dns
core module.
- Example: POST [project_url]/api/shorturl/new
- https://www.google.com
https://forum.freecodecamp.org/
-