The Database Hub | Back4App
The Database Hub | Back4App
How it works
  • Log In
  • Sign Up

  1. Back4App
  2. Parse
Public

16
308
16
308
  • DatabaseDatabase
  • GraphQL API PlaygroundAPI Playground
  • Get Started GuideGet Started
  • IssuesIssues
  • ContributorsContributors
  • GraphQL API Playground
    API Playground
    Get Started Guide
    Get Started
    Issues
    Issues
    Contributors
    Contributors

  1. Parse
  2. Deploying_Parse_Server

Tutorial detailing how to deploy Parse Server.


DataSchema
Get StartedFetch Data
ACLcreatedAtobjectIdupdatedAt
There is no data in this class.
NotesNotes

Deploying Parse Server

Running MongoDB and using parse server locally are the easiest and fastest ways to get started with Parse server. After learning how the project here works, you must learn the deployment process of parse server with major infrastructure providers. Here we will go with different methods of deploying parse server for better understanding:

Deploying to mLab and Heroku

Both of these infrastructures are offering easiest way of deploying parse server, even if you are new to manage your backend. Follow the steps given below to complete the process.

  • For your express ap, create a repo with the middleware mounted parse server.
  • Sign up for a Heroku account, and use its toolbelt to log into the platform and create application in the same directory as of express app.
  • Us the following mLab addons or create your own mongo instance, either with mLab directly or with your own box. heroku addons:create mongolab:sandbox
  • Use Heroku config and copy URI which is being provided under var MONGOLAB_URI by mLab.
  • Use this copied URI to set it as a new config variable as following: heroku config:set DATABASE_URI=mongodb://...
  • Now deploy git push heroku master

Deploying to mLab and Glitch

Before starting to deploy your parse server with Glitch and mLab you have to create a mLab account if you are not having one before. after that follow the step by step process given below for easier deployment:

Create a mLab database

mLab is an effective platform which is offering the services of Database as a Service for the MongoDB. For small sandbox databases, you can enjoy a free trial with ease. However, for this you have to create an account on mLab and after that to get a free database you can use Single-node, Sandbox plan. Within the wizard of mLab, you have to create a user which can have access to connect the created databases. After completion, you have to be able to create a Mongo DB connection string.

Run a parse server example via Glitch

Glitch is an effective and easier way to create and deploy applications based on Node.js for free. Therefore, we can use this to run a parse server example application with ease. However, to make your example server up and running for effective and efficient testing you simply have to click the link given here.

Glitch

Now once your process of import has been completed, then you have to make two minor changes to your .env file, which is actually storing your variables of private environment. This will look something like the statements given below:

# Environment Config

# store your secrets and config variables in here
# only invited collaborators will be able to see your .env values

# reference these in your code with process.env.SECRET

SECRET=
MADE_WITH=

# note: .env is a shell file so there can't be spaces around =
APP_ID=myAppId
MASTER_KEY=your_master_key_here
DATABASE_URI=your_mlab_database_uri_here
SERVER_URL=https://project-name.glitch.me/parse
PARSE_SERVER_LOGS=/tmp

Now make the following changes You have to make the following changes in the above code:

  • Now to make this work, you have to replace the value of your DATABASE_URI with the connecting string of mLab.
  • Change the SERVER_URL’s project name with the name of project you have created.
  • For this tutorial, it is important to make APP_ID as myAppId as the test page expects and hard-codes that value. To keep this project, you have to create a Glitch account, because if you are going to create a project as an anonymous user, then these will expire after five days only. Therefore, it is highly important to create a glitch if you done want to lose your created project in the coming days. Test your project Once you have completed the process of making changes in your .env file, then glitch will build and deploy your project application automatically. While, if you are going to use the feature of Log in your glitch file, then it is important for you to see the following to when your application is going to be deployed. parse-server-example running on port 3000.

Then, you would be able to use the “Show” button to launch your example application project in the browser, and will reach the page that will urge you to begin parse-server GitHub repository. To go to the test harness page add /test to the URL. This will let you test your exercise with dummy collection. If you have completed the processes on this page then your parse server is up and working well.