Error boundaries and laoding status.

This commit is contained in:
richburdon
2020-05-23 16:16:35 -04:00
parent f54cd5b46a
commit 120b9d2e6d
22 changed files with 401 additions and 65 deletions
-4
View File
@@ -1,4 +0,0 @@
{
"port": 4000,
"path": "/graphql"
}
+23
View File
@@ -48,5 +48,28 @@
},
"publishConfig": {
"access": "public"
},
"eslintConfig": {
"parser": "babel-eslint",
"extends": [
"plugin:jest/recommended",
"semistandard",
"standard-jsx"
],
"plugins": [
"babel",
"node"
],
"rules": {
"babel/semi": 1
}
},
"semistandard": {
"parser": "babel-eslint",
"env": [
"jest",
"node",
"browser"
]
}
}
@@ -1,4 +1,9 @@
#
# Copyright 2020 DxOS
#
type Status {
timestamp: String
version: String
}
@@ -1,5 +0,0 @@
{
status {
version
}
}
+5 -6
View File
@@ -9,12 +9,10 @@ import { ApolloServer, gql } from 'apollo-server-express';
import { print } from 'graphql/language';
import QUERY_STATUS from '@dxos/console-client/gql/status.graphql';
import clientConfig from '@dxos/console-client/config.json';
import config from '@dxos/console-client/config.json';
import { resolvers } from './resolvers';
import config from '../config.json';
import SCHEMA from './gql/api.graphql';
const log = debug('dxos:console:server');
@@ -44,11 +42,12 @@ const app = express();
// React app
//
const { public_url } = clientConfig;
const { publicUrl } = config;
app.get(`${public_url}(/:filePath)?`, (req, res) => {
app.get(`${publicUrl}(/:filePath)?`, (req, res) => {
const { filePath = 'index.html' } = req.params;
const file = path.join(__dirname + '../../../../node_modules/@dxos/console-client/dist/production', filePath);
const file = path.join(__dirname, '../../../node_modules/@dxos/console-client/dist/production', filePath);
console.log(__dirname, file);
res.sendFile(file);
});
+3 -2
View File
@@ -2,11 +2,11 @@
// Copyright 2020 DxOS
//
import debug from 'debug';
// import debug from 'debug';
import { version } from '../package.json';
const log = debug('dxos:console:resolver');
// const log = debug('dxos:console:resolver');
//
// Resolver
@@ -15,6 +15,7 @@ const log = debug('dxos:console:resolver');
export const resolvers = {
Query: {
status: () => ({
timestamp: new Date().toUTCString(),
version
})
}