Skip to content

Commit

Permalink
Schema is kind of working.
Browse files Browse the repository at this point in the history
  • Loading branch information
silviogutierrez committed Jul 8, 2018
1 parent b73995c commit fa526f7
Show file tree
Hide file tree
Showing 6 changed files with 323 additions and 26 deletions.
10 changes: 9 additions & 1 deletion index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import ReactDOMServer from 'react-dom/server';
import middleware from 'webpack-dev-middleware';
import {IncomingMessage} from 'http';
import {getStyles} from 'typestyle';

import {compile} from 'json-schema-to-typescript'

import webpackConfig from './webpack.config';

Expand Down Expand Up @@ -78,6 +78,14 @@ const PATHS = [
'/form/',
]

app.get('/schema/', async (req, res) => {
const response = await axios.get('http://localhost:8000/schema/');
const schema = response.data;

const compiled = await compile(schema, schema.title)
res.send(compiled);
});

/*
* An example of a node-space route before we delegate to Django. Useful if we
* need websockets etc.
Expand Down
225 changes: 225 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit fa526f7

Please sign in to comment.