Skip to content

Commit

Permalink
deploy to app engine
Browse files Browse the repository at this point in the history
- added server.js
  • Loading branch information
tjwebb committed Apr 14, 2019
1 parent ec9d127 commit c2cbb2d
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app.yaml
Expand Up @@ -6,4 +6,4 @@ manual_scaling:
resources:
cpu: 1
memory_gb: 0.5
disk_size_gb: 1
disk_size_gb: 10
5 changes: 4 additions & 1 deletion package.json
Expand Up @@ -3,7 +3,10 @@
"version": "0.0.1",
"description": "",
"main": "load-sheets.js",
"dependencies": {},
"dependencies": {
"body-parser": "^1.18.3",
"express": "^4.16.4"
},
"devDependencies": {
"google-spreadsheet": "2.0.7",
"mocha": "6.1.2"
Expand Down
14 changes: 14 additions & 0 deletions server.js
@@ -0,0 +1,14 @@
const express = require('express');
const bodyParser = require('body-parser');
const app = express();
app.use(bodyParser.json());
const RateTable = require('./RateTable');
const rt = new RateTable(require('./rate-table'));

app.post('/rate', (req, res) => {
res.json(rt.getRates(req.body));
});

app.listen(process.env.PORT || 8080, () => {
console.log('listening');
});
2 changes: 2 additions & 0 deletions test/RateTable.test.js
Expand Up @@ -32,6 +32,8 @@ describe('RateTable', () => {
substantially_improved: false
});

console.log(rate);

assert(rate.building_basic === 1.04);
assert(rate.building_additional === -1);
});
Expand Down

0 comments on commit c2cbb2d

Please sign in to comment.