From 8cbce99fafccfbe8db4f1d509f6cbe892eecad2b Mon Sep 17 00:00:00 2001 From: Franziska Hinkelmann Date: Fri, 14 Dec 2018 10:16:01 -0500 Subject: [PATCH] Delete unused appengine/parse-server samples Fixes: https://github.com/GoogleCloudPlatform/nodejs-docs-samples/issues/1003 --- .kokoro/appengine/node10/parse-server.cfg | 13 ------ .kokoro/appengine/node8/parse-server.cfg | 13 ------ appengine/parse-server/README.md | 39 ------------------ appengine/parse-server/app.flexible.yaml | 15 ------- appengine/parse-server/app.standard.yaml | 14 ------- appengine/parse-server/cloud/main.js | 18 -------- appengine/parse-server/config.json | 9 ---- appengine/parse-server/package.json | 16 -------- appengine/parse-server/server.js | 50 ----------------------- 9 files changed, 187 deletions(-) delete mode 100644 .kokoro/appengine/node10/parse-server.cfg delete mode 100644 .kokoro/appengine/node8/parse-server.cfg delete mode 100644 appengine/parse-server/README.md delete mode 100644 appengine/parse-server/app.flexible.yaml delete mode 100644 appengine/parse-server/app.standard.yaml delete mode 100644 appengine/parse-server/cloud/main.js delete mode 100644 appengine/parse-server/config.json delete mode 100644 appengine/parse-server/package.json delete mode 100644 appengine/parse-server/server.js diff --git a/.kokoro/appengine/node10/parse-server.cfg b/.kokoro/appengine/node10/parse-server.cfg deleted file mode 100644 index 01e67fa150..0000000000 --- a/.kokoro/appengine/node10/parse-server.cfg +++ /dev/null @@ -1,13 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Set the folder in which the tests are run -env_vars: { - key: "PROJECT" - value: "appengine/parse-server" -} - -# Tell the trampoline which build file to use. -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/nodejs-docs-samples/.kokoro/build.sh" -} diff --git a/.kokoro/appengine/node8/parse-server.cfg b/.kokoro/appengine/node8/parse-server.cfg deleted file mode 100644 index 01e67fa150..0000000000 --- a/.kokoro/appengine/node8/parse-server.cfg +++ /dev/null @@ -1,13 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Set the folder in which the tests are run -env_vars: { - key: "PROJECT" - value: "appengine/parse-server" -} - -# Tell the trampoline which build file to use. -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/nodejs-docs-samples/.kokoro/build.sh" -} diff --git a/appengine/parse-server/README.md b/appengine/parse-server/README.md deleted file mode 100644 index 93bb4279be..0000000000 --- a/appengine/parse-server/README.md +++ /dev/null @@ -1,39 +0,0 @@ -# Parse-server sample for Google App Engine - -This sample shows how to deploy a [Parse-server](https://github.com/ParsePlatform/parse-server) -app to [Google App Engine](https://cloud.google.com/appengine) Node.js [standard -environment](https://cloud.google.com/appengine/docs/standard/nodejs) -and [flexible environment](https://cloud.google.com/appengine/docs/flexible/nodejs). - -## Setup - -1. Create a project in the [Google Cloud Platform Console](https://console.cloud.google.com/). -1. [Enable billing](https://console.cloud.google.com/project/_/settings) for your project. -1. Install the [Google Cloud SDK](https://cloud.google.com/sdk/). -1. Setup a MongoDB server. Here are two possible options: - 1. Create a Google Compute Engine virtual machine with [MongoDB pre-installed](https://cloud.google.com/launcher/?q=mongodb). - 1. Use [MongoLab](https://mongolab.com/google/) to create a free MongoDB deployment on Google Cloud Platform. - -## Downloading Files - -1. `git clone https://github.com/GoogleCloudPlatform/nodejs-docs-samples.git` -1. `cd appengine/parse-server` - -## Running locally - -1. `npm install` -1. Set the necessary [environment variables](https://github.com/GoogleCloudPlatform/nodejs-docs-samples/blob/master/appengine/parse-server/config.json). -1. `npm start` - -## Deploy to App Engine standard environment - -1. Set the necessary [environment variables](https://github.com/GoogleCloudPlatform/nodejs-docs-samples/blob/master/appengine/parse-server/config.json). -1. `gcloud app deploy app.standard.yaml` - -## Deploy to App Engine flexible environment - -1. Set the necessary [environment variables](https://github.com/GoogleCloudPlatform/nodejs-docs-samples/blob/master/appengine/parse-server/config.json). -1. `gcloud app deploy app.flexible.yaml` - -Refer to the [appengine/README.md](../README.md) file for more instructions on -running and deploying. diff --git a/appengine/parse-server/app.flexible.yaml b/appengine/parse-server/app.flexible.yaml deleted file mode 100644 index 4dfe96aa23..0000000000 --- a/appengine/parse-server/app.flexible.yaml +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright 2016, 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 -env: flex diff --git a/appengine/parse-server/app.standard.yaml b/appengine/parse-server/app.standard.yaml deleted file mode 100644 index adb9c8b03c..0000000000 --- a/appengine/parse-server/app.standard.yaml +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright 2016, 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: nodejs10 diff --git a/appengine/parse-server/cloud/main.js b/appengine/parse-server/cloud/main.js deleted file mode 100644 index 96a393b53c..0000000000 --- a/appengine/parse-server/cloud/main.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Copyright 2016, 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. - */ - -Parse.Cloud.define('hello', function(req, res) { - res.success('Hello, world!'); -}); diff --git a/appengine/parse-server/config.json b/appengine/parse-server/config.json deleted file mode 100644 index 501de725c6..0000000000 --- a/appengine/parse-server/config.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "DATABASE_URI": "mongodb://localhost:27017/dev", - "CLOUD_PATH": "./cloud/main.js", - "APP_ID": "", - "MASTER_KEY": "", - "FILE_KEY": "", - "PARSE_MOUNT_PATH": "/parse", - "SERVER_URL": "" -} diff --git a/appengine/parse-server/package.json b/appengine/parse-server/package.json deleted file mode 100644 index 6633a30b25..0000000000 --- a/appengine/parse-server/package.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "appengine-parse-server", - "description": "Parse-server sample for Google App Engine", - "version": "0.0.1", - "private": true, - "license": "Apache Version 2.0", - "author": "Google Inc.", - "engines": { - "node": ">=8" - }, - "dependencies": { - "express": "4.16.4", - "parse-server": "3.1.2", - "nconf": "0.10.0" - } -} diff --git a/appengine/parse-server/server.js b/appengine/parse-server/server.js deleted file mode 100644 index 44d8d6b502..0000000000 --- a/appengine/parse-server/server.js +++ /dev/null @@ -1,50 +0,0 @@ -/** - * Copyright 2016, 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'; - -const express = require('express'); -const nconf = require('nconf'); -const ParseServer = require('parse-server').ParseServer; -const path = require('path'); - -nconf - .argv() - .env() - .file({file: 'config.json'}); - -const app = express(); - -const parseServer = new ParseServer({ - databaseURI: nconf.get('DATABASE_URI') || 'mongodb://localhost:27017/dev', - cloud: nconf.get('CLOUD_PATH') || path.join(__dirname, '/cloud/main.js'), - appId: nconf.get('APP_ID'), - masterKey: nconf.get('MASTER_KEY'), - fileKey: nconf.get('FILE_KEY'), - serverURL: nconf.get('SERVER_URL'), -}); - -// Mount the Parse API server middleware to /parse -app.use(process.env.PARSE_MOUNT_PATH || '/parse', parseServer); - -app.get('/', (req, res) => { - res.status(200).send('Hello, world!'); -}); - -const PORT = process.env.PORT || 8080; -app.listen(PORT, () => { - console.log(`App listening on port ${PORT}`); - console.log('Press Ctrl+C to quit.'); -});