Description
I just migrated database from parse to my own mongoDB.
All user's file urls are like below in the new mongoDB:
http://mangabir.com:1337/parse/files/mangabird/tfss-5654de28-3768-44de-89fc-f9741087b94f-file
Then, I have downloaded all files from parse s3 using parse-files-utils, all files are saved in ~/parse-files-utils/files/downloaded_files, and my parse server's url is http://mangabir.com:1337/parse, the problem is I don't know where should I put all user's files to, after move all files to ~/parse-server-example/parse/files/mangabird, these file links like http://mangabir.com:1337/parse/files/mangabird/tfss-5654de28-3768-44de-89fc-f9741087b94f-file are still not accessible in browser.
Here is my parse server configurations:
`var express = require('express');
var ParseServer = require('parse-server').ParseServer;
var path = require('path');
var databaseUri = process.env.DATABASE_URI || process.env.MONGODB_URI;
if (!databaseUri) {
console.log('DATABASE_URI not specified, falling back to localhost.');
}
var api = new ParseServer({
databaseURI: databaseUri || 'mongodb://localhost:27017/mangabird',
cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
appId: process.env.APP_ID || 'mangabird',
masterKey: process.env.MASTER_KEY || 'mangabirdappkey', //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
liveQuery: {
classNames: ["Posts", "Comments"] // List of classes to support for query subscriptions
},
publicServerURL: 'http://mangabir.com:1337/parse'
// filesAdapter: {
// "module": "parse-server-fs-adapter",
// "options": {
// "filesSubDirectory": "~/parse-server-example/files/mangabird" // optional
// }
//}
});
// 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
var app = express();
// Serve static assets from the /public folder
app.use('/public', express.static(path.join(__dirname, '/public')));
// Serve the Parse API on the /parse URL prefix
var mountPath = process.env.PARSE_MOUNT || '/parse';
app.use(mountPath, api);
// Parse Server plays nicely with the rest of your web routes
app.get('/', function(req, res) {
res.status(200).send('I dream of being a website. Please star the parse-server repo on GitHub!');
});
// There will be a test page available on the /test path of your server url
// Remove this before launching your app
app.get('/test', function(req, res) {
res.sendFile(path.join(__dirname, '/public/test.html'));`
I'm an iOS & Android developer, maybe it's very simple, but I still can't get it. Hope you guys can help me. Thank you!