Skip to content

Commit

Permalink
Remove the old static html pages, the old API endpoints, and the star…
Browse files Browse the repository at this point in the history
…t of a new front page.
  • Loading branch information
kevinelliott committed Aug 5, 2020
1 parent 5768096 commit 50231b4
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 303 deletions.
23 changes: 4 additions & 19 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,25 +236,6 @@ function fetchFromLaminar(airport, type, userKey) {
// ========================================================================
// API

app.use('/api/arrivals', async (req, res) => {
let r = {
data: []
};

r.data = await fetchFromLaminar('KMHR', 'arrivals', laminarUserKey);
console.log(r);
res.json(r);
});

app.use('/api/departures', async (req, res) => {
let r = {
data: []
};

r.data = await fetchFromLaminar('KMHR', 'departures', laminarUserKey);
res.json(r);
});

app.use('/api/airport/:airport/arrivals', async (req, res) => {
let r = {
data: []
Expand Down Expand Up @@ -299,6 +280,10 @@ app.get('/airports/:airport/departures', function (req, res) {
});
})

app.get('/', function (req, res) {
res.render('index', { title: 'Airport Board' });
});

// ========================================================================
// STATIC FILES
app.use('/', express.static('public'));
Expand Down
145 changes: 0 additions & 145 deletions public/departures.html

This file was deleted.

139 changes: 0 additions & 139 deletions public/index.html

This file was deleted.

30 changes: 30 additions & 0 deletions views/index.pug
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
html
head
title= title
link(rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous")
link(rel="stylesheet" href="/css/base.css")
link(rel="stylesheet" href="/plugins/arrivals/custom.css")
body
div(id="board" style="margin: auto; width: 800px; text-align: center;")
h1 Airport Solari Board
p(style="text-align: justify;").
This is a virtual Airport Arrivals/Depatures board, in style of Solari or Split-Flap mechanical displays. You can see
scheduled arriving and departing flights from your local airport, as well as cancellations and delays. We are currently
using an API feed from AviationStack with a very limited number of allowed requests, so this system will undoubtedly
break after a few days each month until we come up with another solution.
h3 Example Boards
div(class="w-100" style="margin-bottom: 20px; padding: 5px; border: 1px solid #666;")
h4(class="pull-left") KSFO - San Francisco International Airport
div(class="text-right")
a(href="/airports/KSFO/arrivals" class="btn btn-primary" target="_blank") ARRIVALS
a(href="/airports/KSFO/departures" class="btn btn-primary" style="margin-left: 10px;" target="_blank") DEPARTURES
div(class="w-100" style="margin-bottom: 20px; padding: 5px; border: 1px solid #666;")
h4(class="pull-left") KSMF - Sacramento International Airport
div(class="text-right")
a(href="/airports/KSMF/arrivals" class="btn btn-primary" target="_blank") ARRIVALS
a(href="/airports/KSMF/departures" class="btn btn-primary" style="margin-left: 10px;" target="_blank") DEPARTURES
div(class="w-100" style="margin-bottom: 20px; padding: 5px; border: 1px solid #666;")
h4(class="pull-left") KSJC - San Jose International Airport
div(class="text-right")
a(href="/airports/KSJC/arrivals" class="btn btn-primary" target="_blank") ARRIVALS
a(href="/airports/KSJC/departures" class="btn btn-primary" style="margin-left: 10px;" target="_blank") DEPARTURES

0 comments on commit 50231b4

Please sign in to comment.