Skip to content

Commit

Permalink
add start scripts for GAE and Azure
Browse files Browse the repository at this point in the history
  • Loading branch information
Nandan Sridhar committed May 2, 2017
1 parent 43741a7 commit 7fa9ab9
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 2 deletions.
16 changes: 16 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
'use strict';

var run = require('./cli/lib/gateway')();
const os = require('os');

const options = {};

options.env = process.env.EDGEMICRO_ENV;
options.key = process.env.EDGEMICRO_KEY;
options.secret = process.env.EDGEMICRO_SECRET;
options.org = process.env.EDGEMICRO_ORG;
options.configDir = process.env.EDGEMICRO_CONFIG_DIR;
options.processes = os.cpus().length;
options.port = process.env.PORT || 8000;

run.start(options);
31 changes: 31 additions & 0 deletions app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Copyright 2017, Google, Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# [START runtime]
service: microgateway
runtime: nodejs
env: flex
automatic_scaling:
min_num_instances: 1
max_num_instances: 2
resources:
cpu: 1
memory_gb: 2
disk_size_gb: 10
env_variables:
EDGEMICRO_KEY: 'microgateway-key'
EDGEMICRO_SECRET: 'microgateway-secret'
EDGEMICRO_CONFIG_DIR: '/app/config'
EDGEMICRO_ENV: 'env-name'
EDGEMICRO_ORG: 'org-name'
# [END runtime]
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
}
},
"scripts": {
"start": "./cli/edgemicro start",
"start": "node app.js",
"package": "node cli/package.js",
"test": "mocha --timeout 17000 tests"
},
Expand Down Expand Up @@ -84,5 +84,10 @@
"Matt Dobson <[email protected]> (https://github.com/mdobson)",
"Mitch Fierro <[email protected]> (https://github.com/f1erro)"
],
"author": "Kevin Swiber <[email protected]>"
"author": "Kevin Swiber <[email protected]>",
"engines" : {
"node" : ">= 4.8.2 <=6.9.1",
"npm": ">=3.10.8"
},
"cpu" : [ "!arm", "!mips" ]
}

0 comments on commit 7fa9ab9

Please sign in to comment.