Configuring Parse-Server with HTTPS in Express

Although this question was asked long ago, I am trying to answer this question for the future readers as no appropriate answer was posted.

var express = require('express');
var ParseServer = require('parse-server').ParseServer;
var app = express();
var fs = require('fs');

var api = new ParseServer({
    databaseURI: 'mongodb://user:pass@localhost:27017/parse', // Connection string for your MongoDB database
    appId: 'your app id',
    masterKey: 'your app master key', // Keep this key secret!
    serverURL: 'https://localhost:1337/parse' // Don't forget to change to https if needed
});

var options = {
    key: fs.readFileSync('/etc/letsencrypt/live/example.com/privkey.pem'),
    cert: fs.readFileSync('/etc/letsencrypt/live/example.com/fullchain.pem')
};

// Serve the Parse API on the /parse URL prefix
app.use('/parse', api);

var httpsServer = require('https').createServer(options,app);

httpsServer.listen(1337, function() {
    console.log('parse-server-example running on port 1337.');
});