Skip to content

Commit

Permalink
loopback doc fix and fix for redis sample.
Browse files Browse the repository at this point in the history
Style and licenses for appengine/express.

Style and licenses for appengine/geddy.

Style and licenses for appengine/grunt.

License for appengine/hapi and a couple other readme tweaks.

Fixed a bunch more jshint error
  • Loading branch information
jmdobry committed Sep 29, 2015
1 parent c72329e commit c0c1f27
Show file tree
Hide file tree
Showing 87 changed files with 1,141 additions and 9,440 deletions.
5 changes: 5 additions & 0 deletions .jshintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
appengine/kraken/public/components/**
appengine/sails/config/**
appengine/sails/tasks/**
appengine/sails/assets/**
node_modules
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ install:
#Use '-q' to disable interactive prompts

script:
- jshint --exclude-path=.gitignore .
- jshint --exclude-path=.jshintignore .
28 changes: 14 additions & 14 deletions appengine/express/README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
# Express -> Google App Engine

This is a simple guide to running [expressjs](http://expressjs.com/) on Google App Engine.
This is a simple guide to running [expressjs](http://expressjs.com/) on Google App Engine.

1. [Create a new Express app](http://expressjs.com/starter/generator.html)

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

```yaml
runtime: nodejs
vm: true
env_variables:
PORT: 8080
```
```yaml
runtime: nodejs
vm: true
env_variables:
PORT: 8080
```
3. Deploy your app. For convenience, you can use an npm script to run the command. Modify your `package.json` to include:

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

At the terminal you can now run `npm run deploy` to deploy your application.
At the terminal you can now run `npm run deploy` to deploy your application.
22 changes: 17 additions & 5 deletions appengine/express/app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
// Copyright 2015, 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.

'use strict';

var express = require('express');
var path = require('path');
var favicon = require('serve-favicon');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
Expand All @@ -14,8 +28,6 @@ var app = express();
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'jade');

// uncomment after placing your favicon in /public
//app.use(favicon(__dirname + '/public/favicon.ico'));
app.use(logger('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
Expand All @@ -37,7 +49,7 @@ app.use(function(req, res, next) {
// development error handler
// will print stacktrace
if (app.get('env') === 'development') {
app.use(function(err, req, res, next) {
app.use(function(err, req, res) {
res.status(err.status || 500);
res.render('error', {
message: err.message,
Expand All @@ -48,7 +60,7 @@ if (app.get('env') === 'development') {

// production error handler
// no stacktraces leaked to user
app.use(function(err, req, res, next) {
app.use(function(err, req, res) {
res.status(err.status || 500);
res.render('error', {
message: err.message,
Expand Down
13 changes: 13 additions & 0 deletions appengine/express/app.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# Copyright 2015, 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.

runtime: nodejs
api_version: 1
vm: true
Expand Down
2 changes: 2 additions & 0 deletions appengine/express/bin/www
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env node

'use strict';

/**
* Module dependencies.
*/
Expand Down
13 changes: 13 additions & 0 deletions appengine/express/public/stylesheets/style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/** Copyright 2015, 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.
*/
body {
padding: 50px;
font: 14px "Lucida Grande", Helvetica, Arial, sans-serif;
Expand Down
17 changes: 16 additions & 1 deletion appengine/express/routes/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
// Copyright 2015, 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.

'use strict';

var express = require('express');
var router = express.Router();

/* GET home page. */
router.get('/', function(req, res, next) {
router.get('/', function(req, res) {
res.render('index', { title: 'Express |2|' });
});

Expand Down
17 changes: 16 additions & 1 deletion appengine/express/routes/users.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
// Copyright 2015, 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.

'use strict';

var express = require('express');
var router = express.Router();

/* GET users listing. */
router.get('/', function(req, res, next) {
router.get('/', function(req, res) {
res.send('respond with a resource');
});

Expand Down
13 changes: 13 additions & 0 deletions appengine/express/views/error.jade
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
// Copyright 2015, 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.
extends layout

block content
Expand Down
13 changes: 13 additions & 0 deletions appengine/express/views/index.jade
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
// Copyright 2015, 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.
extends layout

block content
Expand Down
13 changes: 13 additions & 0 deletions appengine/express/views/layout.jade
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
// Copyright 2015, 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.
doctype html
html
head
Expand Down
6 changes: 6 additions & 0 deletions appengine/geddy/.jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"node": true,
"globals": {
"geddy": true
}
}
39 changes: 19 additions & 20 deletions appengine/geddy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,32 @@ This is a simple guide to running [geddy](http://geddyjs.org/) on Google App Eng

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

```yaml
runtime: nodejs
vm: true
api_version: 1
env_variables:
PORT: 8080
```
```yaml
runtime: nodejs
vm: true
api_version: 1
env_variables:
PORT: 8080
```
3. Create a `server.js` that contains the following code:

```js
var geddy = require('geddy');
```js
var geddy = require('geddy');
geddy.start({
port: process.env.PORT || '3000'
});
```
geddy.start({
port: process.env.PORT || '3000'
});
```

4. Run `npm install --save geddy`

5. Deploy! For convenience, you can modify your `package.json` to use an npm script for deployment:

```js
"scripts": {
...
"deploy": "gcloud preview app deploy app.yaml --set-default --project [project id]"
}
```
```js
"scripts": {
"deploy": "gcloud preview app deploy app.yaml --set-default --project [project id]"
}
```

At the terminal you can now run `npm run deploy` to deploy your application.
At the terminal you can now run `npm run deploy` to deploy your application.
1 change: 0 additions & 1 deletion appengine/geddy/_session_store.json

This file was deleted.

13 changes: 13 additions & 0 deletions appengine/geddy/app.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# Copyright 2015, 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.

runtime: nodejs
vm: true
api_version: 1
Expand Down
5 changes: 2 additions & 3 deletions appengine/geddy/app/controllers/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@
*
*/

'use strict';

var Application = function () {
};

exports.Application = Application;



8 changes: 4 additions & 4 deletions appengine/geddy/app/controllers/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
*
*/

'use strict';

var Main = function () {
this.index = function (req, resp, params) {
this.respond({params: params}, {
format: 'html'
, template: 'app/views/main/index'
format: 'html',
template: 'app/views/main/index'
});
};
};

exports.Main = Main;


16 changes: 16 additions & 0 deletions appengine/geddy/app/views/errors/default.html.ejs
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
<%
// Geddy JavaScript Web development framework
// Copyright 2112 Matthew Eernisse (mde@fleegix.org)
//
// 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.
%>
<h2>Error: <%= statusCode %> <%= statusText %></h2>
<% if (stack) { %>
<code><%= stack %></code>
Expand Down
16 changes: 16 additions & 0 deletions appengine/geddy/app/views/errors/not_found.html.ejs
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
<%
// Geddy JavaScript Web development framework
// Copyright 2112 Matthew Eernisse (mde@fleegix.org)
//
// 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.
%>
<h2>Error: <%= statusCode %> <%= statusText %></h2>
<% if (message) { %>
<div><%= message; %></div>
Expand Down
Loading

0 comments on commit c0c1f27

Please sign in to comment.