From 2c09123868753a7afe2982af3d156db3c6c6c3a5 Mon Sep 17 00:00:00 2001 From: louis70109 Date: Tue, 2 Aug 2022 13:39:22 +0800 Subject: [PATCH 1/4] update version --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 40944d1..3dfa0bb 100644 --- a/package.json +++ b/package.json @@ -9,9 +9,9 @@ }, "license": "MIT", "dependencies": { - "express": "^4.14.1", + "express": "^4.18.1", "kerberos": "^0.0.x", - "parse-dashboard": "^1.0.24" + "parse-dashboard": "^4.1.4" }, "scripts": { "start": "node index.js" From 6a5893958b0e220cd7b61942696dbade762c0b96 Mon Sep 17 00:00:00 2001 From: louis70109 Date: Tue, 2 Aug 2022 13:59:58 +0800 Subject: [PATCH 2/4] just use dockerfile and heroku app file --- .ebextensions/app.config | 9 --- Dockerfile | 2 + README.md | 123 ---------------------------------- app.json | 5 +- app.yaml | 9 --- azuredeploy.json | 139 --------------------------------------- index.js | 1 - package.json | 3 +- scalingo.json | 24 ------- 9 files changed, 5 insertions(+), 310 deletions(-) delete mode 100644 .ebextensions/app.config delete mode 100644 README.md delete mode 100644 app.yaml delete mode 100644 azuredeploy.json delete mode 100644 scalingo.json diff --git a/.ebextensions/app.config b/.ebextensions/app.config deleted file mode 100644 index a9dc92e..0000000 --- a/.ebextensions/app.config +++ /dev/null @@ -1,9 +0,0 @@ -option_settings: - aws:elasticbeanstalk:application:environment: - APP_ID: "ReplaceWithAppID" - MASTER_KEY: "ReplaceWithMasterKey" - APP_NAME: "ReplaceWithAppName" - NODE_ENV: "production" - SERVER_URL: "http://myappname.elasticbeanstalk.com/parse" - aws:elasticbeanstalk:container:nodejs: - NodeCommand: "npm start" diff --git a/Dockerfile b/Dockerfile index 3451ef7..60abb3d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,6 +9,8 @@ RUN npm install ENV APP_ID setYourAppId ENV MASTER_KEY setYourMasterKey ENV SERVER_URL setYourParseServerUrl +ENV USERNAME setYourUsername +ENV PASSWORD setYourPassword # Optional # ENV APP_NAME setFriendlyAppName diff --git a/README.md b/README.md deleted file mode 100644 index 2e60e2d..0000000 --- a/README.md +++ /dev/null @@ -1,123 +0,0 @@ -# parse-dashboard-example - -Example project using the [parse-dashboard](https://github.com/ParsePlatform/parse-dashboard) module on Express. - -### For Local Development - -* Make sure you have at least Node 4.3. `node --version` -* Clone this repo and change directory to it. -* `npm install` -* Prerequisite: Ensure you have the parse-server installed and working - * Check the parse-server-example project for a quick start: https://github.com/ParsePlatform/parse-server-example -* Run the server with: npm start - -### Using it - -After starting the dashboard, you can visit http://localhost:4040 in your browser - -### Usage -Parse Dashboard can be mounted on an Express app. Express is a web framework for Node.js. The fastest way to get started is to clone the [Parse Dashboard repo](https://github.com/ParsePlatform/parse-dashboard), which at its root contains a sample Express app with the Parse Dashboard API mounted. - -The constructor returns an API object that conforms to an [Express Middleware](http://expressjs.com/en/api.html#app.use). This object provides the REST endpoints for a Parse Dashboard app. Create an instance like so: - -``` -var express = require('express'); -var ParseDashboard = require('parse-dashboard'); - -var dashboard = new ParseDashboard({ - apps: [ - { - appId: process.env.APP_ID || 'myAppId', - masterKey: process.env.MASTER_KEY || 'myMasterKey', - serverURL: process.env.SERVER_URL || 'http://localhost:1337/parse', - appName: process.env.APP_NAME || 'MyApp', - }, - ], -}); - -var app = express(); - -// make the Parse Dashboard available at / -app.use('/', dashboard); - -var port = process.env.PORT || 4040; -var httpServer = require('http').createServer(app); -httpServer.listen(port, function() { - console.log('parse-dashboard-example running on port ' + port + '.'); -}); -``` - -* More configuration options can be found at: [Configuring Parse Dashboard](https://github.com/ParsePlatform/parse-dashboard#configuring-parse-dashboard) - -### Getting Started With Heroku Development - -#### Using Heroku CLI - -* Clone the repo and change directory to it -* Log in with the [Heroku Toolbelt](https://toolbelt.heroku.com/) and create an app: `heroku create` -* Deploy it with: `git push heroku master` -* Open the Heroku dashboard->settings page for your app at: https://dashboard.heroku.com/apps/``/settings -* Click on `Reveal Config Vars` button on the Heroku settings page -* Add the following `Config Vars`. Set them to the values for your `parse-server` -* APP_ID -* MASTER_KEY -* SERVER_URL -* APP_NAME - -#### With the Heroku Button - -[![Deploy](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy) - - -### Getting Started With AWS Elastic Beanstalk - -#### With the Deploy to AWS Button - -* HELP WANTED - Need someone to help document this step - -#### Without It - -* Clone the repo and change directory to it -* Log in with the [AWS Elastic Beanstalk CLI](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli3-install.html), select a region, and create an app: `eb init` -* Create an environment and pass in App ID, Master Key, serverURL and appName (optional): `eb create --envvars APP_ID=, MASTER_KEY=, SERVER_URL=, APP_NAME=` - -### Getting Started With Microsoft Azure App Service - -#### With the Deploy to Azure Button - -[![Deploy to Azure](http://azuredeploy.net/deploybutton.png)](https://azuredeploy.net/) - -#### Without It - -A detailed tutorial is available here: -* HELP WANTED - Need someone to help document the step below correctly -[Azure welcomes Parse developers](https://azure.microsoft.com/en-us/blog/azure-welcomes-parse-developers/) - - -### Getting Started With Google App Engine - -1. Clone the repo and change directory to it -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. Modify `app.yaml` to update your environment variables. -1. Delete `Dockerfile` -1. Deploy it with `gcloud preview app deploy` - -A detailed tutorial is available here: -* HELP WANTED - Need someone to help document the step below correctly -[Running Parse Dashboard server on Google App Engine](https://cloud.google.com/nodejs/resources/frameworks/parse-server) - -### Getting Started With Scalingo - -#### With the Scalingo button - -[![Deploy to Scalingo](https://cdn.scalingo.com/deploy/button.svg)](https://my.scalingo.com/deploy) - -#### Without it - -* HELP WANTED - Need someone to help document the 3 steps below correctly - -* Clone the repo and change directory to it -* Log in with the [Scalingo CLI](http://cli.scalingo.com/) and create an app: `scalingo create my-parse-dashboard` -* Deploy it with: `git push scalingo master` diff --git a/app.json b/app.json index b7f125f..8777f11 100644 --- a/app.json +++ b/app.json @@ -1,8 +1,7 @@ { "name": "Parse Dashboard Example", "description": "An example Parse Dashboard server using the parse-dashboard module", - "repository": "https://github.com/cherukumilli/parse-dashboard-example", - "logo": "https://avatars2.githubusercontent.com/u/5217007?v=3&u=52845c74db401e9fc5df5673460f4d6835a6118a&s=200", + "repository": "https://github.com/louis70109/parse-dashboard-example", "keywords": ["node", "express", "parse", "dashboard"], "env": { "APP_ID": { @@ -23,7 +22,7 @@ }, "USERNAME": { "description": "The username of the account to log into the dashboard.", - "value": "stefanayala3266@gmail.com" + "value": "example@gmail.com" }, "PASSWORD": { "description": "The password of the account to log into your dashboard.", diff --git a/app.yaml b/app.yaml deleted file mode 100644 index e42f494..0000000 --- a/app.yaml +++ /dev/null @@ -1,9 +0,0 @@ -runtime: nodejs -vm: true - -env_variables: - # --REQUIRED-- - APP_ID: - MASTER_KEY: - # --OPTIONAL-- - # APP_NAME: diff --git a/azuredeploy.json b/azuredeploy.json deleted file mode 100644 index 3505a0c..0000000 --- a/azuredeploy.json +++ /dev/null @@ -1,139 +0,0 @@ -{ - "$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "siteName": { - "type": "string" - }, - "hostingPlanName": { - "type": "string" - }, - "siteLocation": { - "type": "string" - }, - "sku": { - "type": "string", - "allowedValues": [ - "Free", - "Shared", - "Basic", - "Standard" - ], - "defaultValue": "Free" - }, - "workerSize": { - "type": "string", - "allowedValues": [ - "0", - "1", - "2" - ], - "defaultValue": "0" - }, - "parseAppId": { - "type": "string", - "minLength": 1, - "defaultValue": "myAppId" - }, - "parseMasterKey": { - "type": "string", - "minLength": 1, - "defaultValue": "myMasterKey" - }, - "parseServerUrl": { - "type": "string", - "minLength": 1, - "defaultValue": "http://yourappname.azure.com/parse" - }, - "repoURL": { - "type": "string", - "defaultValue": "https://github.com/cherukumilli/parse-dashboard-example.git", - "metadata": { - "description": "The URL for the GitHub repository that contains the project to deploy." - } - }, - "branch": { - "type": "string", - "defaultValue": "master", - "metadata": { - "description": "The branch of the GitHub repository to use." - } - } - }, - "resources": [ - { - "apiVersion": "2014-06-01", - "name": "[parameters('hostingPlanName')]", - "type": "Microsoft.Web/serverFarms", - "location": "[parameters('siteLocation')]", - "properties": { - "name": "[parameters('hostingPlanName')]", - "sku": "[parameters('sku')]", - "workerSize": "[parameters('workerSize')]", - "numberOfWorkers": 1 - } - }, - { - "apiVersion": "2014-06-01", - "name": "[parameters('siteName')]", - "type": "Microsoft.Web/Sites", - "location": "[parameters('siteLocation')]", - "dependsOn": [ - "[concat('Microsoft.Web/serverFarms/', parameters('hostingPlanName'))]" - ], - "tags": { - "[concat('hidden-related:', resourceGroup().id, '/providers/Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]": "empty" - }, - "properties": { - "name": "[parameters('siteName')]", - "serverFarm": "[parameters('hostingPlanName')]" - }, - "resources": [ - { - "apiVersion": "2014-04-01", - "type": "config", - "name": "web", - "dependsOn": [ - "[concat('Microsoft.Web/Sites/', parameters('siteName'))]" - ], - "properties": { - "appSettings": [ - { - "name": "APP_ID", - "value": "[parameters('parseAppId')]" - }, - "name": "APP_NAME", - "value": "[parameters('parseAppName')]" - }, - { - "name": "MASTER_KEY", - "value": "[parameters('parseMasterKey')]" - }, - { - "name": "SERVER_URL", - "value": "[parameters('parseServerUrl')]" - }, - { - "name": "WEBSITE_NODE_DEFAULT_VERSION", - "value": "4.2.3" - } - ] - } - }, - { - "apiVersion": "2015-04-01", - "name": "web", - "type": "sourcecontrols", - "dependsOn": [ - "[resourceId('Microsoft.Web/Sites', parameters('siteName'))]" - ], - "properties": { - "RepoUrl": "[parameters('repoURL')]", - "branch": "[parameters('branch')]", - "IsManualIntegration": true - } - } - ] - } - ] -} diff --git a/index.js b/index.js index 7b38e08..f963e0f 100644 --- a/index.js +++ b/index.js @@ -2,7 +2,6 @@ var express = require('express'); var ParseDashboard = require('parse-dashboard'); -var path = require('path'); let localParseServer = 'http://localhost:1337/parse'; // Heroku requires HTTPS. Please read the README file for details. diff --git a/package.json b/package.json index 3dfa0bb..9a40f9e 100644 --- a/package.json +++ b/package.json @@ -5,12 +5,11 @@ "main": "index.js", "repository": { "type": "git", - "url": "https://github.com/cherukumilli/parse-dashboard-example" + "url": "https://github.com/louis70109/parse-dashboard-example" }, "license": "MIT", "dependencies": { "express": "^4.18.1", - "kerberos": "^0.0.x", "parse-dashboard": "^4.1.4" }, "scripts": { diff --git a/scalingo.json b/scalingo.json deleted file mode 100644 index 2feb6f3..0000000 --- a/scalingo.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "Parse Dashboard Example", - "description": "An example Parse Dashboard server using the parse-dashboard module", - "repository": "https://github.com/cherukumilli/parse-dashboard-example", - "logo": "https://avatars2.githubusercontent.com/u/5217007?v=3&u=52845c74db401e9fc5df5673460f4d6835a6118a&s=200", - "env": { - "APP_ID": { - "description": "A unique identifier for your app.", - "value": "" - }, - "MASTER_KEY": { - "description": "A key that overrides all permissions. Keep this secret.", - "value": "" - }, - "SERVER_URL": { - "description": "Parse Server URL.", - "value": "" - }, - "APP_NAME": { - "description": "Optional App Name", - "value": "" - } - } -} From 9be4b1f678db910dadc2f27143207d4db4f56009 Mon Sep 17 00:00:00 2001 From: louis70109 Date: Tue, 2 Aug 2022 14:03:58 +0800 Subject: [PATCH 3/4] restore readme --- README.md | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..9bc17ae --- /dev/null +++ b/README.md @@ -0,0 +1,70 @@ +# parse-dashboard-example + +Example project using the [parse-dashboard](https://github.com/ParsePlatform/parse-dashboard) module on Express. + +### For Local Development + +- Make sure you have at least Node 4.3. `node --version` +- Clone this repo and change directory to it. +- `npm install` +- Prerequisite: Ensure you have the parse-server installed and working + - Check the parse-server-example project for a quick start: https://github.com/ParsePlatform/parse-server-example +- Run the server with: npm start + +### Using it + +After starting the dashboard, you can visit http://localhost:4040 in your browser + +### Usage + +Parse Dashboard can be mounted on an Express app. Express is a web framework for Node.js. The fastest way to get started is to clone the [Parse Dashboard repo](https://github.com/ParsePlatform/parse-dashboard), which at its root contains a sample Express app with the Parse Dashboard API mounted. + +The constructor returns an API object that conforms to an [Express Middleware](http://expressjs.com/en/api.html#app.use). This object provides the REST endpoints for a Parse Dashboard app. Create an instance like so: + +``` +var express = require('express'); +var ParseDashboard = require('parse-dashboard'); + +var dashboard = new ParseDashboard({ + apps: [ + { + appId: process.env.APP_ID || 'myAppId', + masterKey: process.env.MASTER_KEY || 'myMasterKey', + serverURL: process.env.SERVER_URL || 'http://localhost:1337/parse', + appName: process.env.APP_NAME || 'MyApp', + }, + ], +}); + +var app = express(); + +// make the Parse Dashboard available at / +app.use('/', dashboard); + +var port = process.env.PORT || 4040; +var httpServer = require('http').createServer(app); +httpServer.listen(port, function() { + console.log('parse-dashboard-example running on port ' + port + '.'); +}); +``` + +- More configuration options can be found at: [Configuring Parse Dashboard](https://github.com/ParsePlatform/parse-dashboard#configuring-parse-dashboard) + +### Getting Started With Heroku Development + +#### Using Heroku CLI + +- Clone the repo and change directory to it +- Log in with the [Heroku Toolbelt](https://toolbelt.heroku.com/) and create an app: `heroku create` +- Deploy it with: `git push heroku master` +- Open the Heroku dashboard->settings page for your app at: https://dashboard.heroku.com/apps/``/settings +- Click on `Reveal Config Vars` button on the Heroku settings page +- Add the following `Config Vars`. Set them to the values for your `parse-server` +- APP_ID +- MASTER_KEY +- SERVER_URL +- APP_NAME + +#### With the Heroku Button + +[![Deploy](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy) From a42cbaa62c3a4b4c5da2fd3ae94d89c3571a4926 Mon Sep 17 00:00:00 2001 From: NiJia Lin Date: Sat, 20 Aug 2022 00:21:44 +0800 Subject: [PATCH 4/4] try allow HTTP setting --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index f963e0f..8c20c0f 100644 --- a/index.js +++ b/index.js @@ -6,6 +6,7 @@ var ParseDashboard = require('parse-dashboard'); let localParseServer = 'http://localhost:1337/parse'; // Heroku requires HTTPS. Please read the README file for details. let herokuParseServer = 'https://my-parse-dashboard.herokuapp.com/parse'; +let allowInsecureHTTP = true; var dashboard = new ParseDashboard({ apps: [ @@ -20,7 +21,7 @@ var dashboard = new ParseDashboard({ { user: process.env.USERNAME, pass: process.env.PASSWORD } ], trustProxy: 1 -}); +}, allowInsecureHTTP); var app = express(); app.enable('trust proxy');