add api-datadisplay
This commit is contained in:
1
examples/api-datadisplay/api_datadisplay/__init__.py
Normal file
1
examples/api-datadisplay/api_datadisplay/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
__version__ = '0.1.0'
|
||||
31
examples/api-datadisplay/api_datadisplay/main.py
Normal file
31
examples/api-datadisplay/api_datadisplay/main.py
Normal file
@@ -0,0 +1,31 @@
|
||||
from starlette.applications import Starlette
|
||||
from starlette.templating import Jinja2Templates
|
||||
from starlette.routing import Route, Mount
|
||||
from starlette.staticfiles import StaticFiles
|
||||
|
||||
|
||||
templates = Jinja2Templates(directory='templates')
|
||||
|
||||
|
||||
async def home(request):
|
||||
return templates.TemplateResponse(
|
||||
'index.html',
|
||||
{'request': request},
|
||||
)
|
||||
|
||||
routes = [
|
||||
Route('/', endpoint=home),
|
||||
Mount('/static', StaticFiles(directory='../static'), name='static'),
|
||||
Mount(
|
||||
'/node_modules',
|
||||
StaticFiles(directory='../node_modules'),
|
||||
name='node_modules',
|
||||
),
|
||||
Mount(
|
||||
'/bower_components',
|
||||
StaticFiles(directory='../bower_components'),
|
||||
name='bower_components',
|
||||
),
|
||||
]
|
||||
|
||||
app = Starlette(debug=True, routes=routes)
|
||||
@@ -0,0 +1,43 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<!-- Required meta tags -->
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<meta name="description" content="Capacity Dashboard">
|
||||
<meta name="author" content="capacity">
|
||||
<title>api data-display</title>
|
||||
<!-- favicon -->
|
||||
<link rel="shortcut icon" href="{{ url_for('static', path='assets/favicon/favicon-192x192.png')}}">
|
||||
<!-- CSS -->
|
||||
<!-- bootstrap css -->
|
||||
<link rel="stylesheet" type="text/css" href="{{ url_for('node_modules', path='/bootswatch/dist/flatly/bootstrap.min.css') }}">
|
||||
<!-- fakeloader css -->
|
||||
<link rel="stylesheet" type="text/css" href="{{ url_for('node_modules', path='/jq-fakeloader/css/fakeLoader.css') }}">
|
||||
</head>
|
||||
<body>
|
||||
<!-- javascript -->
|
||||
<!-- jquery js -->
|
||||
<script type="text/javascript" src="{{ url_for('node_modules', path='/jquery/dist/jquery.min.js') }}"></script>
|
||||
<!-- bootstrap js -->
|
||||
<script type="text/javascript" src="{{ url_for('node_modules', path='/bootstrap/dist/js/bootstrap.bundle.js') }}"></script>
|
||||
<!-- font-awesome js -->
|
||||
<script type="text/javascript" src="{{ url_for('node_modules', path='/@fortawesome/fontawesome-free/js/fontawesome.min.js') }}"></script>
|
||||
<!-- fakeloader js -->
|
||||
<script type="text/javascript" src="{{ url_for('node_modules', path='/jq-fakeloader/js/fakeLoader.js') }}"></script>
|
||||
<!-- begin document -->
|
||||
<!-- load scripts -->
|
||||
<!-- <div class="fakeLoader"></div> -->
|
||||
<script type="text/javascript">
|
||||
$.fakeLoader({'timeToHide':1200, 'spinner':'spinner4', 'bgColor': '#00003c'});
|
||||
</script>
|
||||
<script type="text/javascript">$('.toast').toast()</script>
|
||||
<div class="jumbotron">
|
||||
<h1 class="display-4">Hello, world! <i class="fas fa-globe-europe"></i></h1>
|
||||
<p class="lead">This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information.</p>
|
||||
<hr class="my-4">
|
||||
<p>It uses utility classes for typography and spacing to space content out within the larger container.</p>
|
||||
<a class="btn btn-primary btn-lg" href="#" role="button">Learn more</a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user