Skip to content

Commit

Permalink
in-progress heroku deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
sunuwars committed Oct 18, 2018
1 parent 6335bb4 commit 913516a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,8 @@
"react-testing-library": "^5.2.0",
"supertest": "^3.3.0"
},
"proxy": "http://localhost:5000"
"proxy": "http://localhost:5000",
"engines": {
"node": "v10.6.0"
}
}
5 changes: 5 additions & 0 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ var bodyParser = require('body-parser');
var getAllEventsAirTable = require('./queryHandlers/getAllEventsAirTable');
var contactUs = require('./queryHandlers/contactUs');
var getPastEventsAirTable = require('./queryHandlers/getPastEventsAirTable');
const path = require('path')

const app = express();

Expand All @@ -16,6 +17,10 @@ app.use(bodyParser.json());

app.use(express.static(path.join(__dirname, '..', 'dist')));

// if (process.env.NODE_ENV === 'production') {
// app.use(express.static(path.join(__dirname, ' ')))
// }

app.get('/api/getAllEventsAirTable', getAllEventsAirTable.get);
app.get('/api/getPastEventsAirTable', getPastEventsAirTable.get)
// POST route from contact form
Expand Down
1 change: 1 addition & 0 deletions src/controllers/database/db_connection.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require("env2")("./config.env");
const Airtable = require('airtable');


Airtable.configure({
endpointUrl: 'https://api.airtable.com',
apiKey: process.env.AIRTABLE_API_KEY,
Expand Down
5 changes: 1 addition & 4 deletions src/server.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const app = require('./app')
const path = require('path')
const express = require('express')
// const controllers = require('../src/controllers')

Expand All @@ -8,9 +7,7 @@ const express = require('express')
const port = process.env.PORT || 5000;
// app.use(controllers)

if (process.env.NODE_ENV === 'production') {
app.use(express.static(path.join(__dirname, 'parcel:build')))
}


app.listen(port, () => {
console.log(`Listening on port ${port}`);
Expand Down

0 comments on commit 913516a

Please sign in to comment.