私たちのiOsアプリケーションをParseからAWSに移行しようとしています。 Curlを使用すると関数にアクセスできますが、それ以外の場合はエラーが発生します。ここにindex.jsファイルがありますが、私たちは間違って何をしていますか?ご意見をお聞かせください。XMLHttpRequestに失敗しました: "Parse APIに接続できません" '}}コード= 141、コード= 100
var express = require('express');
var ParseServer = require('parse-server').ParseServer;
var path = require('path');
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
var databaseUri = process.env.DATABASE_URI || process.env.MONGODB_URI || 'mongodb://xxxxxxxxxx';
if (!databaseUri) {
console.log('DATABASE_URI not specified, falling back to localhost.');
}
var S3Adapter = require('parse-server').S3Adapter;
var api = new ParseServer({
//databaseURI: databaseUri || 'mongodb://localhost:27017/dev',
databaseURI: databaseUri || 'xxxxx',
cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
appId: process.env.APP_ID || 'xxxxx',
masterKey: process.env.MASTER_KEY || 'xxxxxx', //Add your master key here. Keep it secret!
fileKey: process.env.FILE_KEY || 'xxxxx',
//restAPIKey: process.env.REST_API_KEY || 'xxxx',
javascriptKey: process.env.JAVASCRIPT_KEY || 'xxxxx',
serverURL: process.env.SERVER_URL || 'http://parseserver-2uxxxxx.elasticbeanstalk.com/', // Don't forget to change to https if needed
filesAdapter: new S3Adapter(
"xxxxxx",
"xxxxxxxx",
"xxxxx",
{directAccess: true}
),
liveQuery: {
classNames: ["xxx", "xxx", "xxxxx", "xxx"] // List of classes to support for query subscriptions
}
});
// 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'));
});
var port = process.env.PORT || 1337;
var httpServer = require('http').createServer(app);
httpServer.listen(port, function() {
console.log('parse-server-example running on port ' + port + '.');
});
// This will enable the Live Query real-time server
ParseServer.createLiveQueryServer(httpServer);
私たちは、パースからAWSへの私たちのiOSアプリを移行しようとしています。 Curlを使用すると関数にアクセスできますが、それ以外の場合はエラーが発生します。ここにindex.jsファイルがありますが、私たちは間違って何をしていますか?ご意見をお聞かせください。
デイヴィッド、ありがとう!我々は何か大きな間違ったことをしなければならない。あなたの指示に沿ってコードを展開しました。それを修正した後でも構文エラーが発生していました。奇妙なことは、コードを外しても、同じエラーがログに表示され続けていたことです。新しい雇用がElasticBeanの茎によって無視されているように見えました。私たちはまだ立ち往生しています。 –
サーバーをApacheに変更しました。 –