Skip to content

Commit dbf88be

Browse files
author
Matthew Dobson
authored
Merge branch 'master' into saml-integration
2 parents 243ed0d + 830d1fb commit dbf88be

File tree

5 files changed

+72
-7
lines changed

5 files changed

+72
-7
lines changed

app.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
'use strict';
2+
3+
var run = require('./cli/lib/gateway')();
4+
const os = require('os');
5+
6+
const options = {};
7+
8+
options.env = process.env.EDGEMICRO_ENV;
9+
options.key = process.env.EDGEMICRO_KEY;
10+
options.secret = process.env.EDGEMICRO_SECRET;
11+
options.org = process.env.EDGEMICRO_ORG;
12+
options.configDir = process.env.EDGEMICRO_CONFIG_DIR;
13+
options.processes = process.env.EDGEMICRO_PROCESSES || os.cpus().length;
14+
options.port = process.env.PORT || 8000;
15+
16+
run.start(options);

app.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Copyright 2017, Google, Inc.
2+
# Licensed under the Apache License, Version 2.0 (the "License");
3+
# you may not use this file except in compliance with the License.
4+
# You may obtain a copy of the License at
5+
#
6+
# http://www.apache.org/licenses/LICENSE-2.0
7+
#
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
#
14+
# [START runtime]
15+
service: microgateway
16+
runtime: nodejs
17+
env: flex
18+
automatic_scaling:
19+
min_num_instances: 1
20+
max_num_instances: 2
21+
resources:
22+
cpu: 1
23+
memory_gb: 2
24+
disk_size_gb: 10
25+
env_variables:
26+
EDGEMICRO_KEY: 'microgateway-key'
27+
EDGEMICRO_SECRET: 'microgateway-secret'
28+
EDGEMICRO_CONFIG_DIR: '/app/config'
29+
EDGEMICRO_ENV: 'env-name'
30+
EDGEMICRO_ORG: 'org-name'
31+
# [END runtime]

cli/lib/cert-lib.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ CertLogic.prototype.installPrivateCert = function(options, callback) {
101101

102102
const privateKey = keys.serviceKey;
103103
const publicKey = keys.certificate;
104-
105104
const async = require('async');
106105
async.series(
107106
[
@@ -132,8 +131,8 @@ CertLogic.prototype.installPrivateCert = function(options, callback) {
132131
} else {
133132
callback(null, publicKey);
134133
}
135-
}
136-
);
134+
);
135+
});
137136
});
138137
}
139138

@@ -179,8 +178,8 @@ CertLogic.prototype.installCertWithPassword = function(options, callback) {
179178
} else {
180179
callback(null, publicKey);
181180
}
182-
}
183-
);
181+
);
182+
});
184183
});
185184
}
186185

manifest.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
applications:
3+
- name: edgemicro-app
4+
memory: 512M
5+
instances: 1
6+
host: edgemicro-app
7+
path: .
8+
buildpack: nodejs_buildpack
9+
env:
10+
EDGEMICRO_KEY: 'microgateway-key'
11+
EDGEMICRO_SECRET: 'microgateway-secret'
12+
EDGEMICRO_CONFIG_DIR: '/app/config'
13+
EDGEMICRO_ENV: 'env-name'
14+
EDGEMICRO_ORG: 'org-name'

package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
}
5252
},
5353
"scripts": {
54-
"start": "./cli/edgemicro start",
54+
"start": "node app.js",
5555
"package": "node cli/package.js",
5656
"test": "mocha --timeout 17000 tests"
5757
},
@@ -84,5 +84,10 @@
8484
"Matt Dobson <mdobson@apigee.com> (https://github.com/mdobson)",
8585
"Mitch Fierro <fierro.mitch@gmail.com> (https://github.com/f1erro)"
8686
],
87-
"author": "Kevin Swiber <kswiber@gmail.com>"
87+
"author": "Kevin Swiber <kswiber@gmail.com>",
88+
"engines" : {
89+
"node" : ">= 4.8.2",
90+
"npm": ">=3.10.8"
91+
},
92+
"cpu" : [ "!arm", "!mips" ]
8893
}

0 commit comments

Comments
 (0)