feat: Asynchronous initialization of Parse Server (#8232)
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)
This commit is contained in:
@@ -158,9 +158,18 @@ export function handleParseHeaders(req, res, next) {
|
||||
}
|
||||
|
||||
const clientIp = getClientIp(req);
|
||||
const config = Config.get(info.appId, mount);
|
||||
if (config.state && config.state !== 'ok') {
|
||||
res.status(500);
|
||||
res.json({
|
||||
code: Parse.Error.INTERNAL_SERVER_ERROR,
|
||||
error: `Invalid server state: ${config.state}`,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
info.app = AppCache.get(info.appId);
|
||||
req.config = Config.get(info.appId, mount);
|
||||
req.config = config;
|
||||
req.config.headers = req.headers || {};
|
||||
req.config.ip = clientIp;
|
||||
req.info = info;
|
||||
|
||||
Reference in New Issue
Block a user