added static python server

master
Malar Kannan 2017-07-12 12:10:24 +05:30
parent f60865f64c
commit 292df97183
3 changed files with 116 additions and 18 deletions

104
.gitignore vendored
View File

@ -21,3 +21,107 @@ yarn-debug.log*
yarn-error.log* yarn-error.log*
public/png public/png
# Created by https://www.gitignore.io/api/python
### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# pyenv
.python-version
# celery beat schedule file
celerybeat-schedule
# SageMath parsed files
*.sage.py
# dotenv
.env
# virtualenv
.venv
venv/
ENV/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# End of https://www.gitignore.io/api/python

View File

@ -9,24 +9,7 @@ import {
} from 'semantic-ui-react'; } from 'semantic-ui-react';
const { Box } = require('reflexbox'); const { Box } = require('reflexbox');
const imageRoot = 'http://localhost:3000/png/'; const imageRoot = '/png/';
// export const fieldMetaMap = {
// label: { lens: 'label[0]', type: 'text' },
// unl: { lens: 'unl[0]', type: 'text' },
// synset: { lens: 'lexprops[0].wnsynset[0]', type: 'text' },
// guid: { lens: 'guid[0]', type: 'text' },
// pos: { lens: 'pos[0]', type: 'select' },
// image: { lens: 'image[0]', type: 'preview' },
// relations: { lens: 'relations[0]', type: 'text' },
// frame: { lens: 'syntacticprops[0].property[0]._', type: 'select' },
// morphclass: {
// lens: 'lexprops[0].morphology[0].morph[0]._',
// type: 'select'
// },
// stats: { lens: 'stats[0].property[0]._', type: 'text' },
// lang: { lens: '$.id', type: 'select' },
// };
export class LexEdit extends React.Component<any, any> { export class LexEdit extends React.Component<any, any> {
public render() { public render() {

11
walle-server.py Normal file
View File

@ -0,0 +1,11 @@
from flask import Flask,send_from_directory
app = Flask(__name__,static_url_path='',static_folder='build')
import os
@app.route('/static/<path:path>')
def send_js(path):
return send_from_directory('build/static', path)
@app.route('/')
def hello_world():
return app.send_static_file('index.html')