Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions brouillon.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
var api = new ParseServer({
//**** General Settings ****//

databaseURI: databaseUri || 'mongodb://localhost:27017/dev',
cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
serverURL: process.env.SERVER_URL || 'http://localhost:1337/parse', // Don't forget to change to https if needed

//**** Security Settings ****//
// allowClientClassCreation: process.env.CLIENT_CLASS_CREATION || false,
appId: process.env.APP_ID || 'myAppId',
masterKey: process.env.MASTER_KEY || 'myMasterKey', //Add your master key here. Keep it secret!

//**** Live Query ****//
// liveQuery: {
// classNames: ["TestObject", "Place", "Team", "Player", "ChatMessage"] // List of classes to support for query subscriptions
// },

//**** Email Verification ****//
/* Enable email verification */
// verifyUserEmails: true,
/* The public URL of your app */
// This will appear in the link that is used to verify email addresses and reset passwords.
/* Set the mount path as it is in serverURL */
// publicServerURL: process.env.SERVER_URL || 'http://localhost:1337/parse',
/* This will appear in the subject and body of the emails that are sent */
// appName: process.env.APP_NAME || "CodeCraft",

// emailAdapter: {
// module: 'parse-server-simple-mailgun-adapter',
// options: {
// fromAddress: process.env.EMAIL_FROM || "test@example.com",
// domain: process.env.MAILGUN_DOMAIN || "example.com",
// apiKey: process.env.MAILGUN_API_KEY || "apikey"
// }
// },

//**** File Storage ****//
// filesAdapter: new S3Adapter(
// {
// directAccess: true
// }
// )
});
74 changes: 28 additions & 46 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,63 +1,45 @@

//Ici Erki
var express = require('express');
var ParseServer = require('parse-server').ParseServer;
// var S3Adapter = require('parse-server').S3Adapter;
var path = require('path');

var databaseUri = process.env.DATABASE_URI || process.env.MONGODB_URI;
//var databaseUri = "mongodb+srv://erki:erki@cluster0.wnloab9.mongodb.net/?retryWrites=true&w=majority";

if (!databaseUri) {
console.log('DATABASE_URI not specified, falling back to localhost.');
}
const masterKey = 'erki-master';
const appId = 'erki';
const jsKey = 'erki-jsKey';
const serverUrl = 'http://localhost:3000/api';
const databaseURI = "mongodb+srv://erki:erki@cluster0.wnloab9.mongodb.net/?retryWrites=true&w=majority";
const serverConfig = {
databaseURI : databaseURI,
appId : appId,
cloud : '/cloud/main.js',
javascriptKey : jsKey,
masterKey : masterKey,
serverURL : serverUrl,
appName : 'ErkiApp'
};

var api = new ParseServer({
//**** General Settings ****//

databaseURI: databaseUri || 'mongodb://localhost:27017/dev',
cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
serverURL: process.env.SERVER_URL || 'http://localhost:1337/parse', // Don't forget to change to https if needed

//**** Security Settings ****//
// allowClientClassCreation: process.env.CLIENT_CLASS_CREATION || false,
appId: process.env.APP_ID || 'myAppId',
masterKey: process.env.MASTER_KEY || 'myMasterKey', //Add your master key here. Keep it secret!

//**** Live Query ****//
// liveQuery: {
// classNames: ["TestObject", "Place", "Team", "Player", "ChatMessage"] // List of classes to support for query subscriptions
// },

//**** Email Verification ****//
/* Enable email verification */
// verifyUserEmails: true,
/* The public URL of your app */
// This will appear in the link that is used to verify email addresses and reset passwords.
/* Set the mount path as it is in serverURL */
// publicServerURL: process.env.SERVER_URL || 'http://localhost:1337/parse',
/* This will appear in the subject and body of the emails that are sent */
// appName: process.env.APP_NAME || "CodeCraft",

// emailAdapter: {
// module: 'parse-server-simple-mailgun-adapter',
// options: {
// fromAddress: process.env.EMAIL_FROM || "test@example.com",
// domain: process.env.MAILGUN_DOMAIN || "example.com",
// apiKey: process.env.MAILGUN_API_KEY || "apikey"
// }
// },

//**** File Storage ****//
// filesAdapter: new S3Adapter(
// {
// directAccess: true
// }
// )
});
// Client-keys like the javascript key or the .NET key are not necessary with parse-server
// If you wish you require them, you can set them as options in the initialization above:
// javascriptKey, restAPIKey, dotNetKey, clientKey

const api = new ParseServer(serverConfig);
var app = express();

var dashboard = new ParseDashboard({
apps: [
{
serverURL: "http://localhost:3000/api",
appId: "erki",
masterKey: "erki-master",
appName: "MyApp"
}
]
});
// Serve static assets from the /public folder
app.use('/public', express.static(path.join(__dirname, '/public')));

Expand Down
Loading