Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
57 lines (52 sloc) 2.47 KB
<!DOCTYPE html>
<html lang='en'>
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
<meta name='viewport' content='width=device-width, initial-scale=1'>
<title>Serverless S3 storage prices</title>
<link rel='stylesheet' href='' integrity='sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u' crossorigin='anonymous'>
<div class='container'>
<h1>S3 Storage prices</h1>
<p>This page shows the pricing history of the <a href=''>four main S3 storage types</a> provided by Amazon S3. All prices are for the <strong>eu-west-1</strong> region.</p>
<p id='loading'><em>Loading prices...</em></p>
<div class='table-responsive'>
<table class='table table-striped' style='display: none'>
<th>Storage type</th>
<th>Range (GB)</th>
<script src=''></script>
// Using good-old jQuery to fill the table with s3 prices received from the API Gatway endpoint
$(document).ready(function() {
var api_gateway_url = '';
var months = ["January", "February", "March", "April", "June", "July", "August", "September", "October", "November", "December"];
var rows = [];
$.get(api_gateway_url, function(data) {
data.forEach(function(item) {
date = new Date(parseInt(item['Date']['S']));
formatted_date = `${months[date.getMonth()]} ${date.getDate()}, ${date.getFullYear()}`;
// build an array of rows containing the prices
rows.push(`<tr> \
<td>${formatted_date}</td> \
<td>${item['StorageType']['S']}</td> \
<td>$${item['Price']['S']}</td> \
<td>${item['BeginRange']['S']} - ${item['EndRange']['S']}</td> \
// show the now filled table and hide the "loading" message