A back-end to do something with the requests and generate responses.To accomplish this I needed a few components: Define everything via code as much as possible to make it reproducible.The redirection endpoint should be accessible without authentication while the POST should require authentication.A second HTTP endpoint to take a short token via GET, lookup a corresponding destination URL, and return a 301 redirect. These values would need to be stored somewhere. One HTTP endpoint to accept a JSON POST containing a short token and destination URL.Here were the basic requirements for the project: There’s also an accompanying code repo that you can use to try this out yourself and learn how to build a url shortener. This post walks through the setup along with the hitches I hit. With a few hours of work and a few dollars per month in cost I got a decent prototype working capable of handling millions of requests per month. So to get myself familiar with the finer points of serverless apps I decided to launch a simple project: figuring out how to build a url shortener Of course, no platform is without tradeoffs. Running a web application without the costs or headaches of maintaining servers is attractive. I’ve had my eye on Amazon’s Lambda and API Gateway services for a few months.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |