Hi @davimacedo, here is the code
// Create the Parse Server API
const api = new ParseServer({
databaseURI: databaseUri || defaultDatabaseUri,
cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
appId: process.env.APP_ID || 'XXXXXXXXXXXX',
masterKey: process.env.MASTER_KEY || 'XXXXXXXXXXXX', // Add your master key here. Keep it secret!
serverURL: process.env.SERVER_URL || 'http://localhost:1337/parse', // Don't forget to change to https if needed
allowClientClassCreation: false,
enableAnonymousUsers: false, // default is true, we may want this.
verifyUserEmails: true,
publicServerURL: `${publicServerURL}${mountPath}` || 'https://api.mydomain.com/1',
preventLoginWithUnverifiedEmail: false,
appName: 'XXXXXXXXX',
// sessionLength: 31536000, // 1 year, default value
// emailVerifyTokenValidityDuration: undefined, // default
revokeSessionOnPasswordReset: true,
emailAdapter: PostmarkAdapter({
apiKey: process.env.POSTMARK_API,
fromAddress: process.env.POSTMARK_FROM_ADDRESS,
}),
accountLockout: {
duration: 5, // duration policy setting determines the number of minutes that a locked-out account remains locked out before automatically becoming unlocked. Set it to a value greater than 0 and less than 100000.
threshold: 3, // threshold policy setting determines the number of failed sign-in attempts that will cause a user account to be locked. Set it to an integer value greater than 0 and less than 1000.
},
customPages: {
invalidLink: `${publicServerURL}/public/invalid.html`,
choosePassword: `${publicServerURL}/public/change_password.html`,
passwordResetSuccess: `${publicServerURL}/public/success.html`,
verifyEmailSuccess: `${publicServerURL}/public/verify_email.html`,
},
});
// Create the app and init our custom APIs
const app = coreApi.initApp(serverId);
// Serve the Parse API on the /1 URL prefix
app.use(mountPath, api);
// Final handler - Bugsnag. This handles any errors that Express catches
app.use(coreApi.bugsnagMiddleware.errorHandler);
// Start the server
const httpServer = require('http').createServer(app);
httpServer.listen(port, function() {
console.info(`API Server running on port ${port} for environment ${serverId}.`);
console.info(`Connected to database: ${coreApi.utils.getSafeDbURI(databaseUri)}`);
});
// This will enable the Live Query real-time server
ParseServer.createLiveQueryServer(httpServer);
Many thanks