Skip to content

Commit fc84342

Browse files
committed
Updated the companion app with routing and a second page for showing
albums from itunes. The package.json file now also includes a script called "build-dev" that builds the angular app and then copies the contents of the 'dist' folder into the bombayjs-companion-app-backend directory which is our own little backend that serves up the UI. Tons of modifications in this commit but what we haven't yet done is update the jasmine spec file to test the new route
1 parent 0d8780e commit fc84342

36 files changed

+30985
-13115
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ build/Release
3030
# Dependency directories
3131
node_modules
3232
jspm_packages
33+
bombayjs-companion-app-backend/node_modules
3334

3435
# Optional npm cache directory
3536
.npm

bombayjs-companion-app-backend/app.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,29 @@ var express = require('express');
22
var request = require('request');
33
var app = express();
44

5+
const PORT_NUM = 4200;
6+
57
// This endpoint is a gateway for calling the itunes service.
6-
app.use('/api', function(req, res) {
8+
app.use('/albums', function(req, res) {
79
var url = "https://itunes.apple.com/search" + req.url;
810
req.pipe(request(url)).pipe(res);
911
});
1012

1113
// This endpoint is a gateway for calling the google finance api.
1214
app.use('/finance', function(req, res) {
1315
var url = "http://finance.google.com/finance" + req.url;
16+
console.log('++hdd++ req.url = ' + req.url);
17+
req.pipe(request(url)).pipe(res);
18+
});
19+
20+
// This endpoint is a gateway for calling bombayjs endpoints
21+
app.use('/testfinance', function(req, res) {
22+
var url = "http://localhost:3039/finance" + req.url;
1423
req.pipe(request(url)).pipe(res);
1524
});
1625

17-
app.listen(4200, function () {
18-
console.log('Listening on port 4200');
26+
app.listen(PORT_NUM, function () {
27+
console.log(`Listening on port ${PORT_NUM}`);
1928
});
2029

2130
app.use(express.static("./"));

bombayjs-companion-app-backend/endpoints.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

bombayjs-companion-app-backend/index.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@
88
<meta name="viewport" content="width=device-width, initial-scale=1">
99
<link rel="icon" type="image/x-icon" href="favicon.ico">
1010

11+
<!-- Bootstrap stuff -->
12+
<!--<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
13+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
14+
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>-->
1115

12-
<!-- bombay.js -->
13-
<script language="javascript" src="endpoints.js"></script>
1416

1517
</head>
1618

bombayjs-companion-app-backend/inline.bundle.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)