Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var express = require('express');
- var ParseServer = require('parse-server').ParseServer;
- var app = express();
- // Specify the connection string for your mongodb database
- // and the location to your Parse cloud code
- var databaseUri = process.env.DATABASE_URI || 'private';
- var S3Adapter = require('parse-server').S3Adapter;
- var api = new ParseServer({
- databaseURI: databaseUri || 'mongodb://localhost:27017/dev',
- cloud: "/opt/bitnami/apps/parse/htdocs/cloud/main.js",
- appId: "private",
- masterKey: "private",
- fileKey: "8639157b-cef3-4b3e-9f23-c1c83085f886",
- enableAnonymousUsers: false,
- verifyUserEmails: true,
- appName: 'IronTrainers',
- serverURL: "private" || 'http://localhost:1337/parse',
- publicServerURL: "private",
- liveQuery: {
- classNames: ["UserConfig", "StaffITMessages"] // List of classes to support for query subscriptions
- },
- push: {
- ios: [
- {
- pfx: '/opt/bitnami/apps/parse/htdocs/certificates/IronTrainersCertificate.p12', // Dev PFX or P12
- topic: '-.IRON-TRAINERS',
- production: true // Dev
- },
- {
- pfx: '/opt/bitnami/apps/parse/htdocs/certificates/IronTrainersCertificate.p12', // Dev PFX or P12
- topic: '-.IRON-TRAINERS',
- production: false // Dev
- }//,
- //{
- // topic: 'apps.IT-Medical',
- // production: true // Prod
- // }
- ],
- android:
- {
- senderId: '407700652754',
- apiKey:'private-E0'
- }
- },
- filesAdapter: new S3Adapter(
- "private",
- "private",
- "parse-prod-iron",
- {
- directAccess: true,
- region: "sa-east-1"
- }
- ),
- emailAdapter: {
- module: 'parse-server-amazon-ses-email-adapter',
- options: {
- // The address that your emails come from
- fromAddress: 'Iron Trainers <private>',
- accessKeyId: 'private',
- secretAccessKey: 'private',
- region: 'eu-west-1',
- // The template section
- templates: {
- passwordResetEmail: {
- subject: 'Redefinir sua senha Iron Trainers',
- pathPlainText: '/opt/bitnami/apps/parse/htdocs/node_modules/parse-server/node_modules/parse-server-amazon-ses-email-adapter/test/email-templates/password_reset_email.txt',
- pathHtml: '/opt/bitnami/apps/parse/htdocs/node_modules/parse-server/node_modules/parse-server-amazon-ses-email-adapter/test/email-templates/password_reset_email.html',
- callback: (user) => {
- return {
- nome: user.get("nome"),
- sobrenome: user.get("sobrenome")
- }
- }
- // Now you can use {{firstName}} in your templates
- },
- verificationEmail: {
- subject: 'Confirmar email no Iron Trainers',
- pathPlainText: '/opt/bitnami/apps/parse/htdocs/node_modules/parse-server/node_modules/parse-server-amazon-ses-email-adapter/test/email-templates/verification_email.txt',
- pathHtml: '/opt/bitnami/apps/parse/htdocs/node_modules/parse-server/node_modules/parse-server-amazon-ses-email-adapter/test/email-templates/resendEmailVerification.html',
- pathHtml_en: '/opt/bitnami/apps/parse/htdocs/node_modules/parse-server/node_modules/parse-server-amazon-ses-email-adapter/test/email-templates/resendEmailVerification.html',
- callback: (user) => {
- return {
- nome: user.get('nome'),
- teste: 'this is a test',
- }
- }
- // Now you can use {{firstName}} in your templates
- },
- customEmailAlert: {
- subject: 'Urgent notification!',
- pathPlainText: '/opt/bitnami/apps/parse/htdocs/node_modules/parse-server/node_modules/parse-server-amazon-ses-email-adapter/test/email-templates/custom_alert.txt',
- pathHtml: '/opt/bitnami/apps/parse/htdocs/node_modules/parse-server/node_modules/parse-server-amazon-ses-email-adapter/test/email-templates/custom_alert.html',
- callback: (user) => {
- return {
- nome: user.get("nome"),
- sobrenome: user.get("sobrenome")
- }
- }
- }
- }
- }
- },
- customPages: {
- invalidLink: 'http://irontrainers.com.br/members/invalid_link.html',
- verifyEmailSuccess: 'http://irontrainers.com.br/members/verify_email_success.html',
- choosePassword: 'http://irontrainers.com.br/members/choose_password.html',
- passwordResetSuccess: 'http://irontrainers.com.br/members/password_reset_success.html'
- }// JavaScript Document
- });
- process.on('unhandledRejection', (reason, p) => {
- console.log('Unhandled Rejection at: Promise', p, 'reason:', reason);
- // application specific logging, throwing an error, or other logic here
- });
- // Serve the Parse API on the /parse URL prefix
- app.use('/parse', api);
- var allowInsecureHTTP = true;
- var port = 1337;
- app.listen(port, function() {
- console.log('parse-server running on port ' + port);
- });
- //Parse Dashboard
- var ParseDashboard = require('parse-dashboard');
- var dashboard = new ParseDashboard({
- apps: [
- {
- appName: "My Bitnami Parse API",
- appId: "private",
- masterKey: "private",
- fileKey: "private-cef3-4b3e-9f23-private",
- production: true,
- serverURL: "private"
- }
- ],
- users: [
- {
- user: "private",
- pass: "private"
- }
- ], useEncryptedPasswords: false
- }, allowInsecureHTTP);
- //var allowInsecureHTTP = true;
- // Serve the Parse Dashboard on the /parsedashboard URL prefix
- app.use('/', dashboard);
- var portdash = 4040;
- app.listen(portdash, function() {
- console.log('parse-dashboard running on port ' + portdash);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement