{"info":{"_postman_id":"41152726-4a54-45f7-9cee-a03a3413c232","name":"ShortenEncoderUrl","description":"<html><head></head><body><h1 id=\"introduction\">Introduction</h1>\n<p>Send <code>POST</code> request and get a shortened url, see the original url generated by entering the encoded url via <code>GET</code> \n🇧🇷</p>\n<h1 id=\"overview\">Overview</h1>\n<h3 id=\"how-to-run-it\">How to run it?</h3>\n<ol>\n<li><code>npm install</code></li>\n<li><code>npm run dev</code> for development running</li>\n<li><code>npm run build</code> for build it</li>\n<li><code>npm run prod</code> for run in production</li>\n</ol>\n<h1 id=\"authentication\">Authentication</h1>\n<p>You need to authenticate and connect to a PostgreSQL database \nCreate a <code>.env</code> file on project's root with fields</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-bash\">DB_HOST=[YOUR_HOST]\nDB_USER=[YOUR_USER]\nDB_PASSWORD=[YOUR_PASSWORD]\nDB_PORT=[YOUR_PORT]\nDB_DATABASE=[YOUR_DATABASE]\nSERVER_URL=[YOUR_URL_ADDRESS]\n</code></pre>\n<h1 id=\"error-codes\">Error Codes</h1>\n<p>404 error not found if the shorten url id is not in database anymore.</p>\n<h1 id=\"rate-limit\">Rate limit</h1>\n<p>unlimited</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[{"content":"Introduction","slug":"introduction"},{"content":"Overview","slug":"overview"},{"content":"Authentication","slug":"authentication"},{"content":"Error Codes","slug":"error-codes"},{"content":"Rate limit","slug":"rate-limit"}],"owner":"7161525","collectionId":"41152726-4a54-45f7-9cee-a03a3413c232","publishedId":"TWDZJbgm","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2021-02-23T20:26:50.000Z"},"item":[{"name":"http://localhost:3000/l5IZd","id":"41991747-492f-4d1b-aa6a-83941da891ce","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:3000/g4JtN","description":"<p>short url to get redirect</p>\n","urlObject":{"protocol":"http","port":"3000","path":["g4JtN"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"b90c78a3-88fe-4f65-a5e9-6dcc23a04d95","name":"http://localhost:3000/l5IZd","originalRequest":{"method":"GET","header":[],"url":"https://murmuring-crag-82988.herokuapp.com/g4JtN"},"status":"Not Found","code":404,"_postman_previewlanguage":"html","header":[{"key":"Server","value":"Cowboy"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Type","value":"text/html; charset=utf-8"},{"key":"Content-Length","value":"13"},{"key":"Etag","value":"W/\"d-GGADl3lI8gBfkBaoQapIv1P1IZk\""},{"key":"Date","value":"Tue, 23 Feb 2021 20:24:45 GMT"},{"key":"Via","value":"1.1 vegur"}],"cookie":[],"responseTime":null,"body":"URL not found"}],"_postman_id":"41991747-492f-4d1b-aa6a-83941da891ce"},{"name":"http://localhost:3000","id":"70b1933e-9caf-4bef-af6d-dbaeaf42a63e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n\t\"url\": \"www.youtube.com\"\t\n}"},"url":"http://localhost:3000","description":"<p>post url</p>\n","urlObject":{"protocol":"http","port":"3000","host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"1bb80acf-2664-4996-946c-ab739c3c6092","name":"http://localhost:3000","originalRequest":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n\t\"url\": \"www.youtube.com\"\t\n}"},"url":"https://murmuring-crag-82988.herokuapp.com"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"Cowboy"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"61"},{"key":"Etag","value":"W/\"3d-pWIzZzfjHL7BE4ZQqU/U3Xcmxw4\""},{"key":"Date","value":"Tue, 23 Feb 2021 20:25:09 GMT"},{"key":"Via","value":"1.1 vegur"}],"cookie":[],"responseTime":null,"body":"{\n    \"newUrl\": \"https://murmuring-crag-82988.herokuapp.com/wec8N\"\n}"}],"_postman_id":"70b1933e-9caf-4bef-af6d-dbaeaf42a63e"},{"name":"http://localhost:3000","id":"c27bb83f-d192-4096-be4e-16767040611e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n\t\"url\": \"www.youtube.com\",\n\t\"expiryTime\": \"500\",\n\t\"leng\": 5\n\t\n}"},"url":"http://localhost:3000","description":"<p>extra fields expiryTime in seconds to and leng to determine length of new url</p>\n","urlObject":{"protocol":"http","port":"3000","host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"8818677e-8111-4a04-85b1-46f514632ba4","name":"http://localhost:3000","originalRequest":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n\t\"url\": \"www.youtube.com\",\n\t\"expiryTime\": \"500\",\n\t\"leng\": 5\n\t\n}"},"url":"https://murmuring-crag-82988.herokuapp.com"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"Cowboy"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"61"},{"key":"Etag","value":"W/\"3d-CWdFFUH2pyU9VKJbrUoJrLkUsBE\""},{"key":"Date","value":"Tue, 23 Feb 2021 20:25:27 GMT"},{"key":"Via","value":"1.1 vegur"}],"cookie":[],"responseTime":null,"body":"{\n    \"newUrl\": \"https://murmuring-crag-82988.herokuapp.com/Gh8YS\"\n}"}],"_postman_id":"c27bb83f-d192-4096-be4e-16767040611e"}]}