UI server refactoring (#5580)

* Full API in Authenticated WS server.

* Replacing UI server with Hyper.

* Solving CLI, RPCs and tests.

* Porting signer tests.

* Fixing origin recognition for dapps/rpc.

* Fixing tests. Adding parity-rpc-client to test.

* Dapps exposed as RPC method.

* JS code to support new connection scheme.

* Fixing dapps tests.

* Updating allowed origins/hosts to support web3.site.

* Fixing tests, fixing UI.

* Fixing tests.

* Removing invalid tests.

* Fixing merge.

* 404 fallback for UI

* Improve ContentFetcher constructor readability.

* Naming.

* Update .gitlab-ci.yml

fix CI lint error

* Fixing tests and linting issues.

* Fixing new tests.

* UI hosts.

* Submodules fix.
This commit is contained in:
Tomasz Drwięga
2017-05-24 12:24:07 +02:00
committed by Arkadiy Paronyan
parent 7499efecf6
commit cbcc369a2d
91 changed files with 2171 additions and 2591 deletions

View File

@@ -25,21 +25,6 @@ import builtinJson from '~/views/Dapps/builtin.json';
const builtinApps = builtinJson.filter((app) => app.id);
function getHost (api) {
const host = process.env.DAPPS_URL ||
(
process.env.NODE_ENV === 'production'
? api.dappsUrl
: ''
);
if (host === '/') {
return '';
}
return host;
}
export function subscribeToChanges (api, dappReg, callback) {
return dappReg
.getContract()
@@ -105,12 +90,7 @@ export function fetchBuiltinApps () {
}
export function fetchLocalApps (api) {
return fetch(`${getHost(api)}/api/apps`)
.then((response) => {
return response.ok
? response.json()
: [];
})
return api.parity.dappsList()
.then((apps) => {
return apps
.map((app) => {
@@ -195,7 +175,7 @@ export function fetchManifest (api, manifestHash) {
}
return fetch(
`${getHost(api)}/api/content/${manifestHash}/`,
`/api/content/${manifestHash}/`,
{ redirect: 'follow', mode: 'cors' }
)
.then((response) => {