ビルド中のアプリケーションのビルド プロセス (Ext JS + 別のアプリのバックエンドを使用) を作成し、ローカル URL を変更する「ベスト プラクティス」の方法 (例: data/my-data. json) を開発サーバーのバックエンドに送信し、その後、運用サーバーのバックエンドに送信します。
私のストアには現在、次のコードがあります。
Ext.define('APP.store.DataRecords', {
extend: 'Ext.data.Store',
model: 'APP.model.DataRecord',
autoLoad: true,
proxy: {
type: 'ajax',
api: {
read: 'data/data-records.json',
update: 'data/update-data-records.json'
},
reader: {
type: 'json',
root: 'records',
successProperty: 'success'
}
}
});
sencha build コマンドを実行すると、ストアが次のように変換されるのが理想的です。
Ext.define('APP.store.DataRecords', {
extend: 'Ext.data.Store',
model: 'APP.model.DataRecord',
autoLoad: true,
proxy: {
type: 'ajax',
api: {
read: 'http://mydevserver/.../data-records.json',
update: 'http://mydevserver/.../update-data-records.json'
},
reader: {
type: 'json',
root: 'records',
successProperty: 'success'
}
}
});
「直接的な」アプローチがない場合、最初にすべての URL を再マップし、次に sencha コンパイラを呼び出す追加のスクリプトを作成する必要があると思います。
PS通常、これはすべて「相対」URL を使用して透過的に行われることを理解していますが、やり取りしているバックエンドにはいくつかの制限があり、これが妨げられています。
考え?
前もって感謝します!