Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added "engines" to package.json files. Made package.json and readme f… #17

Merged
merged 1 commit into from
Oct 16, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions appengine/express/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
## Express on Google App Engine

> [Express](http://expressjs.com) is a minimal and flexible Node.js web application framework that provides a robust set of features for web and mobile applications.
> [Express](http://expressjs.com) is a minimal and flexible Node.js web
application framework that provides a robust set of features for web and mobile
applications.

### Create a new Express app

View the [Express app generator guide](http://expressjs.com/starter/generator.html).

### Configure

Create an `app.yaml` in the root of your application with the following contents:
Create an `app.yaml` in the root of your application with the following
contents:

```yaml
runtime: nodejs
Expand All @@ -20,13 +23,19 @@ env_variables:

### Deploy

For convenience, you can use an npm script to run the deploy command. Modify your `package.json` to include:
For convenience, you can use an npm script to run the `gcloud` command. Add
these lines to your `package.json` file:

```json
"scripts": {
"start": "node ./bin/www",
"deploy": "gcloud preview app deploy app.yaml --set-default --project [project id]"
"deploy": "gcloud preview app deploy app.yaml --promote --project <your-project-id>"
}
```

At the terminal you can now run `npm run deploy` to deploy your application.
At the terminal you can now run the following command to deploy your
application:

```
$ npm deploy
```
10 changes: 7 additions & 3 deletions appengine/express/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
{
"name": "express",
"version": "0.0.0",
"name": "appengine-express",
"description": "An example of running Express.js on Google App Engine.",
"version": "0.0.1",
"private": true,
"license": "Apache Version 2.0",
"engines": {
"node": "~0.12.7"
},
"scripts": {
"start": "node ./bin/www",
"deploy": "gcloud preview app deploy app.yaml --set-default --project express-demo"
"deploy": "gcloud preview app deploy app.yaml --promote --project express-demo"
},
"dependencies": {
"body-parser": "^1.14.1",
Expand Down
1 change: 1 addition & 0 deletions appengine/geddy/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ npm-debug.log
config/secrets.json
public/js/core/models.js
public/js/core/helpers.js
_session_store.json
37 changes: 26 additions & 11 deletions appengine/geddy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

### Configure

Create an `app.yaml` in the root of your application with the following contents:
Create an `app.yaml` in the root of your application with the following
contents:

```yaml
runtime: nodejs
Expand All @@ -20,26 +21,40 @@ env_variables:

### Prepare the app

Create a `server.js` that contains the following code:
If you haven't already, install the Geddy CLI:

```js
var geddy = require('geddy');
```
$ npm install -g geddy
```

Create a `config/secrets.json` file:

geddy.start({
port: process.env.PORT || 8080
});
```
$ echo "{}" > config/secrets.json
```

Run `npm install --save geddy`
Generate an app secret:

```
$ geddy gen secret
```

### Deploy

For convenience, you can use an npm script to run the deploy command. Modify your `package.json` to include:
For convenience, you can use an npm script to run the `gcloud` command. Add
these lines to your `package.json` file:

```json
"scripts": {
"deploy": "gcloud preview app deploy app.yaml --set-default --project [project id]"
"start": "node node_modules/geddy/bin/cli.js",
"debug": "node node_modules/geddy/bin/cli.js --debug",
"deploy": "gcloud preview app deploy app.yaml --promote --project <your-project-id>"
}
```

At the terminal you can now run `npm run deploy` to deploy your application.
At the terminal you can now run the following command to deploy your
application:

```
$ npm deploy
```
2 changes: 1 addition & 1 deletion appengine/geddy/config/development.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ var config = {
excludePattern: '\\.git|node_modules'
},
hostname: null,
port: 4000,
port: process.env.PORT || 8080,
model: {
defaultAdapter: 'filesystem'
},
Expand Down
2 changes: 1 addition & 1 deletion appengine/geddy/config/production.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var config = {
appName: 'Geddy App',
detailedErrors: false,
hostname: null,
port: 4000,
port: process.env.PORT || 8080,
model: {
defaultAdapter: 'mongo'
},
Expand Down
17 changes: 9 additions & 8 deletions appengine/geddy/package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
{
"name": "appengine-geddy",
"description": "An example of running geddy on Google App Engine. ",
"author": "",
"description": "An example of running Geddy.js on Google App Engine.",
"version": "0.0.1",
"private": true,
"license": "Apache Version 2.0",
"dependencies": {
"geddy": "^13.0.8"
},
"devDependencies": {},
"engines": {
"node": "0.12.x"
"node": "~0.12.7"
},
"scripts": {
"deploy": "gcloud preview app deploy app.yaml --set-default --project geddy-demo"
"start": "node node_modules/geddy/bin/cli.js",
"debug": "node node_modules/geddy/bin/cli.js --debug",
"deploy": "gcloud preview app deploy app.yaml --promote --project geddy-demo"
},
"dependencies": {
"geddy": "^13.0.8"
}
}
22 changes: 0 additions & 22 deletions appengine/geddy/server.js

This file was deleted.

23 changes: 16 additions & 7 deletions appengine/grunt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,43 @@

### Configure

Create an `app.yaml` in the root of your application with the following contents:
Create an `app.yaml` in the root of your application with the following
contents:

```yaml
runtime: nodejs
vm: true
api_version: 1
env_variables:
NPM_CONFIG_DEV: true
PORT: 8080
```

Run `npm install --save-dev grunt-cli` to make the Grunt command line tools available locally during the build.
Run `npm install --save-dev grunt-cli` to make the Grunt command line tools
available locally during the build.

### Deploy

Modify your `package.json` to include an npm `postinstall` script. This will be run during your applications `npm install` phase.
Modify your `package.json` to include an npm `postinstall` script. This will
be run during your applications `npm install` phase.

For convenience, you can use an npm script to run the deploy command. Modify your `package.json` to include:
For convenience, you can use an npm script to run the deploy command. Modify
your `package.json` to include:

```json
"scripts": {
"start": "node ./src/bin/www",
"postinstall": "./node_modules/grunt-cli/bin/grunt build",
"deploy": "gcloud preview app deploy app.yaml --set-default --project gruntjs-demo",
"browse": "open http://gruntjs-demo.appspot.com"
"deploy": "gcloud preview app deploy app.yaml --promote --project <your-project-id>"
}
```

At the terminal you can now run `npm run deploy` to deploy your application.
At the terminal you can now run the following command to deploy your
application:

```
$ npm deploy
```

The `postinstall` script causes the `grunt build` command to be executed after
the `npm install` command succeeds. This allows you to execute the build after
Expand Down
21 changes: 11 additions & 10 deletions appengine/grunt/package.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
{
"name": "appengine-grunt",
"version": "0.0.0",
"name": "appengine-gruntjs",
"description": "An example of running Grunt.js on Google App Engine.",
"version": "0.0.1",
"private": true,
"license": "Apache Version 2.0",
"engines": {
"node": "~0.12.7"
},
"scripts": {
"start": "node ./src/bin/www",
"postinstall": "./node_modules/grunt-cli/bin/grunt build",
"deploy": "gcloud preview app deploy app.yaml --set-default --project gruntjs-demo",
"browse": "open http://gruntjs-demo.appspot.com"
"deploy": "gcloud preview app deploy app.yaml --promote --project gruntjs-demo"
},
"dependencies": {
"body-parser": "^1.14.1",
"cookie-parser": "^1.4.0",
"debug": "^2.2.0",
"express": "^4.13.3",
"jade": "^1.11.0",
"morgan": "^1.6.1",
"serve-favicon": "^2.3.0"
},
"devDependencies": {
"grunt": "^0.4.5",
"grunt-cli": "^0.1.13",
"grunt-contrib-clean": "^0.6.0",
"grunt-contrib-cssmin": "^0.14.0",
"grunt-contrib-jshint": "^0.11.2",
"grunt-contrib-watch": "^0.6.1"
"grunt-contrib-watch": "^0.6.1",
"jade": "^1.11.0",
"morgan": "^1.6.1",
"serve-favicon": "^2.3.0"
}
}
12 changes: 9 additions & 3 deletions appengine/hapi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,19 @@ server.connection({

### Deploy

For convenience, you can use an npm script to run the deploy command. Modify your `package.json` to include:
For convenience, you can use an npm script to run the `gcloud` command. Add
these lines to your `package.json` file:

```json
"scripts": {
"start": "node index.js",
"deploy": "gcloud preview app deploy app.yaml --set-default --project [project id]"
"deploy": "gcloud preview app deploy app.yaml --promote --project <your-project-id>"
}
```

At the terminal you can now run `npm run deploy` to deploy your application.
At the terminal you can now run the following command to deploy your
application:

```
$ npm deploy
```
2 changes: 1 addition & 1 deletion appengine/hapi/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var Hapi = require('hapi');
// Create a server with a host and port
var server = new Hapi.Server();
server.connection({
host: '127.0.0.1',
host: '0.0.0.0',
port: process.env.PORT || 8080
});
// [END server]
Expand Down
24 changes: 10 additions & 14 deletions appengine/hapi/package.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
{
"name": "hapi-appengine",
"version": "1.0.0",
"description": "An example of running hapijs apps on Google App Engine. ",
"main": "index.js",
"name": "appengine-hapi",
"description": "An example of running Hapi.js on Google App Engine.",
"version": "0.0.1",
"private": true,
"license": "Apache Version 2.0",
"engines": {
"node": "~0.12.7"
},
"scripts": {
"start": "node index.js",
"deploy": "gcloud preview app deploy app.yaml --set-default --project hapi-demo"
"deploy": "gcloud preview app deploy app.yaml --promote --project hapi-demo"
},
"keywords": [
"appengine",
"google",
"nodejs",
"hapi"
],
"author": "Justin Beckwith",
"license": "Apache Version 2.0",
"dependencies": {
"hapi": "^10.1.0"
"hapi": "^10.5.0"
}
}
15 changes: 11 additions & 4 deletions appengine/koa/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,24 @@ env_variables:

Run `npm init` to initialize a `package.json`.

Modify your `package.json`. Add a `start` command - take care to include the `--harmony` flag, as koa requires generators.
Modify your `package.json`. Add a `start` command - take care to include the
`--harmony` flag, as Koa.js requires generators.

### Deploy

For convenience, you can use an npm script to run the deploy command. Modify your `package.json` to include:
For convenience, you can use an npm script to run the `gcloud` command. Add
these lines to your `package.json` file:

```json
"scripts": {
"start": "node --harmony app.js",
"deploy": "gcloud preview app deploy app.yaml --set-default --project [project id]"
"deploy": "gcloud preview app deploy app.yaml --promote --project <your-project-id>"
}
```

At the terminal you can now run `npm run deploy` to deploy your application.
At the terminal you can now run the following command to deploy your
application:

```
$ npm deploy
```
Loading