This repository has been archived by the owner on Sep 25, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
[WIP]: Cloud endpoints and GAE Flex support #116
Closed
Closed
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
f1f51f1
update(api): enable Google Edge caching.
Splaktar 2dc4bf8
update(express): remove blitzio magic endpoint and returning 42.
Splaktar 651b9f2
update(about): remove out of date references to Yeoman, Redis, Openshift
Splaktar bbaed00
update(server): remove Redis, clustering. Convert session storage to …
Splaktar 43c57cc
update(server): setup for GAE Flex and Cloud Endpoints.
Splaktar 66db763
update(server): enable cloud debug and cloud trace
Splaktar c5c854f
fix(build): jshint and karma warnings
Splaktar 4f76f3b
Merge branch 'removeRedis' into cloudEndpointsAndGaeFlex
Splaktar f44fa9b
update(ci): drop testing of Node 0.12 and 5.x. Add 7.x testing.
Splaktar b27772c
update(express): clarify cache config. disable yes-https for now.
Splaktar ca34f27
update(ci): revert change to remove bower install
Splaktar 429e24b
update(npm): update uglify and phantomjs
Splaktar 3db4882
update(server): changes that finally got the API working on GAE Flex!…
Splaktar 3d00dc1
update(server): move health checks up so that they aren't double logged
Splaktar 17c1f3e
update(server): remote rate metering
Splaktar c090780
Merge branch 'removeRedis' into cloudEndpointsAndGaeFlex
Splaktar 93930d8
update(server): setup for GAE Flex and Cloud Endpoints.
Splaktar 1f3f57b
update(server): enable cloud debug and cloud trace
Splaktar 5308488
update(ci): drop testing of Node 0.12 and 5.x. Add 7.x testing.
Splaktar 4e8231f
update(express): clarify cache config. disable yes-https for now.
Splaktar cce809a
update(ci): revert change to remove bower install
Splaktar df8d2cd
update(npm): update uglify and phantomjs
Splaktar f4beee3
update(server): changes that finally got the API working on GAE Flex!…
Splaktar dc344c7
update(server): move health checks up so that they aren't double logged
Splaktar e5eceab
Merge remote-tracking branch 'origin/cloudEndpointsAndGaeFlex' into c…
Splaktar 9254820
Merge remote-tracking branch 'upstream/cloudEndpointsAndGaeFlex' into…
Splaktar a080d7c
fix(api): fix merge issue
Splaktar 8ab1945
update(npm): update to latest csurf
Splaktar b2b22e5
fix(keys): fix error when process.env.ANDROID_CLIENT_IDS is undefined
Splaktar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
test/ | ||
|
||
node_modules/ | ||
.git/ | ||
coverage/ | ||
npm-debug.log | ||
|
||
.dockerignore | ||
Dockerfile | ||
|
||
.gitignore | ||
.gitattributes | ||
.editorconfig | ||
.idea/ | ||
*.md | ||
*.iml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
.DS_Store | ||
node_modules | ||
public | ||
.tmp | ||
/node_modules | ||
/public | ||
/.tmp | ||
/tmp | ||
.sass-cache | ||
app/bower_components | ||
heroku | ||
/app/bower_components | ||
/views | ||
dist | ||
.idea | ||
/dist | ||
/.idea | ||
newrelic_agent.log | ||
.c9 | ||
mongodb | ||
*.log | ||
.env | ||
.env-prod | ||
npm-debug.log.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
4.6.1 | ||
6.9.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
runtime: nodejs | ||
env: flex | ||
handlers: | ||
- url: /.* | ||
script: IGNORED | ||
endpoints_api_service: | ||
name: api.gdgx.io | ||
config_id: 2017-03-18r0 | ||
network: | ||
instance_tag: https-server | ||
name: default | ||
automatic_scaling: | ||
min_num_instances: 1 | ||
max_num_instances: 2 | ||
cool_down_period_sec: 300 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
cron: | ||
- description: daily 9am EST ingestion job | ||
url: / | ||
schedule: every day 13:00 | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,12 +6,17 @@ var rootPath = path.normalize(__dirname + '/../../..'); | |
|
||
module.exports = { | ||
root: rootPath, | ||
port: process.env.PORT || process.env.NODEJS_PORT || 3000, | ||
hostname: process.env.NODEJS_IP || undefined, | ||
port: process.env.PORT || 3000, | ||
hostname: undefined, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was key in getting GAE Flex working. If I put anything in here it would cause forwarding from the GAE proxy to Express to fail and give |
||
mongo: { | ||
options: { | ||
db: { | ||
safe: true | ||
}, | ||
server: { | ||
socketOptions: { | ||
keepAlive: 1 | ||
} | ||
} | ||
} | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,13 +8,17 @@ var express = require('express'), | |
path = require('path'), | ||
passport = require('passport'), | ||
config = require('./config'); | ||
var errorhandler = require('errorhandler'); | ||
var errorHandler = require('errorhandler'); | ||
var morgan = require('morgan'); | ||
var compression = require('compression'); | ||
var bodyParser = require('body-parser'); | ||
// var yesHttps = require('yes-https'); | ||
const MongoStore = require('connect-mongo')(session); | ||
// var csrf = require('csurf'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
const STATIC_FILE_CACHE_AGE = 604800000; // 1 week | ||
// const YES_HTTPS_MAX_AGE = 120000; // 2 minutes | ||
|
||
/** | ||
* Express configuration | ||
*/ | ||
|
@@ -34,7 +38,7 @@ module.exports = function (app) { | |
|
||
app.use(express.static(path.join(config.root, '.tmp'))); | ||
app.use(express.static(path.join(config.root, 'app'))); | ||
app.use(errorhandler()); | ||
app.use(errorHandler()); | ||
app.set('views', config.root + '/app/views'); | ||
|
||
app.use(session({ | ||
|
@@ -49,8 +53,8 @@ module.exports = function (app) { | |
if (process.env.NODE_ENV === 'production') { | ||
app.use(favicon(path.join(config.root, 'public', 'favicon.ico'), {})); | ||
app.use(compression()); | ||
app.use(express.static(path.join(config.root, 'public'), {maxAge: 604800000})); | ||
app.set('views', config.root + '/views'); | ||
app.use(express.static(path.join(config.root, 'public'), { maxAge: STATIC_FILE_CACHE_AGE, etag: true })); | ||
app.set('views', config.root + '/public/views'); | ||
|
||
app.use(session({ | ||
cookie: { secure: true }, | ||
|
@@ -61,6 +65,13 @@ module.exports = function (app) { | |
})); | ||
} | ||
|
||
// Configure GAE proxy and health checks. Force HTTPS. | ||
app.enable('trust proxy'); | ||
// app.use(yesHttps({ maxAge: YES_HTTPS_MAX_AGE, includeSubdomains: true, preload: true })); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
app.get('/_ah/health', (req, res) => { | ||
res.sendStatus(200); | ||
}); | ||
|
||
app.engine('html', require('ejs').renderFile); | ||
app.set('view engine', 'html'); | ||
app.use(morgan('[' + process.pid + '] :method :url :status :response-time ms - :res[content-length]')); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
{ | ||
"swagger": "2.0", | ||
"info": { | ||
"version": "1.0.0", | ||
"title": "GDG-X Hub API", | ||
"description": "API for using data from the Google Developer Groups (GDG) Hub.", | ||
"license": { | ||
"name": "MIT" | ||
}, | ||
"contact": { | ||
"name": "GDG-X Support", | ||
"email": "[email protected]" | ||
} | ||
}, | ||
"host": "api.gdgx.io", | ||
"basePath": "/api/v1", | ||
"consumes": [ | ||
"application/json" | ||
], | ||
"produces": [ | ||
"application/json" | ||
], | ||
"schemes": [ | ||
"https" | ||
], | ||
"paths": { | ||
"/chapters": { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OpenAPI Spec TODO:
|
||
"get": { | ||
"operationId": "listChapters", | ||
"description": "Returns a list containing all Chapters", | ||
"responses": { | ||
"200": { | ||
"description": "Success", | ||
"schema": { | ||
"$ref": "#/definitions/ChapterList" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"definitions": { | ||
"ChapterList": { | ||
"type": "object", | ||
"properties": { | ||
"count": { | ||
"type": "number" | ||
}, | ||
"pages": { | ||
"type": "number" | ||
}, | ||
"page": { | ||
"type": "number" | ||
}, | ||
"perpage": { | ||
"type": "number" | ||
}, | ||
"items": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/definitions/Chapter" | ||
} | ||
} | ||
} | ||
}, | ||
"Chapter": { | ||
"type": "object", | ||
"properties": { | ||
"_id": { | ||
"type": "string" | ||
}, | ||
"created_at": { | ||
"type": "string" | ||
}, | ||
"updated_at": { | ||
"type": "string" | ||
}, | ||
"site": { | ||
"type": "string" | ||
}, | ||
"group_type": { | ||
"type": "string" | ||
}, | ||
"country": { | ||
"type": "string" | ||
}, | ||
"state": { | ||
"type": "string" | ||
}, | ||
"city": { | ||
"type": "string" | ||
}, | ||
"name": { | ||
"type": "string" | ||
}, | ||
"__v": { | ||
"type": "number" | ||
}, | ||
"organizers": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"geo": { | ||
"$ref": "#/definitions/Location" | ||
} | ||
} | ||
}, | ||
"Location": { | ||
"type": "object", | ||
"required": [ | ||
"lng", "lat" | ||
], | ||
"properties": { | ||
"lng": { | ||
"type": "number" | ||
}, | ||
"lat": { | ||
"type": "number" | ||
} | ||
} | ||
} | ||
}, | ||
"security": [ | ||
|
||
], | ||
"securityDefinitions": { | ||
|
||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.