BREAKING CHANGE: This release introduces the asynchronous initialization of Parse Server to prevent mounting Parse Server before being ready to receive request; it changes how Parse Server is imported, initialized and started; it also removes the callback `serverStartComplete`; see the [Parse Server 6 migration guide](https://github.com/parse-community/parse-server/blob/alpha/6.0.0.md) for more details (#8232)
26 lines
738 B
JavaScript
Executable File
26 lines
738 B
JavaScript
Executable File
#!/usr/bin/env node
|
|
const MongoStorageAdapter = require('../../lib/Adapters/Storage/Mongo/MongoStorageAdapter').default;
|
|
const { GridFSBucketAdapter } = require('../../lib/Adapters/Files/GridFSBucketAdapter');
|
|
|
|
const ParseServer = require('../../lib/index').ParseServer;
|
|
|
|
const databaseURI = 'mongodb://doesnotexist:27017/parseServerMongoAdapterTestDatabase';
|
|
|
|
(async () => {
|
|
try {
|
|
await ParseServer.startApp({
|
|
appId: 'test',
|
|
masterKey: 'test',
|
|
databaseAdapter: new MongoStorageAdapter({
|
|
uri: databaseURI,
|
|
mongoOptions: {
|
|
serverSelectionTimeoutMS: 2000,
|
|
},
|
|
}),
|
|
filesAdapter: new GridFSBucketAdapter(databaseURI),
|
|
});
|
|
} catch (e) {
|
|
process.exit(1);
|
|
}
|
|
})();
|