Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
parlapi
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
David Guillot
parlapi
Commits
c54b123f
Commit
c54b123f
authored
Feb 09, 2017
by
Nicolas Joyard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ajout multichambre
parent
50efbb0c
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
59 additions
and
50 deletions
+59
-50
parlapi/rest/setup.py
parlapi/rest/setup.py
+1
-1
parlapi/routes.py
parlapi/routes.py
+4
-5
parlapi/setup_app.py
parlapi/setup_app.py
+3
-3
parlapi/static/chamber-an.png
parlapi/static/chamber-an.png
+0
-0
parlapi/static/chamber-sen.png
parlapi/static/chamber-sen.png
+0
-0
parlapi/templates/index.html
parlapi/templates/index.html
+51
-41
No files found.
parlapi/rest/setup.py
View file @
c54b123f
...
...
@@ -28,7 +28,7 @@ from ..models import (
)
def
setup_api
(
app
):
def
setup_a
n_a
pi
(
app
):
api
=
API
(
app
)
api
.
endpoint
(
...
...
parlapi/routes.py
View file @
c54b123f
...
...
@@ -9,9 +9,9 @@ import humanize
from
.models
import
Job
def
setup_routes
(
app
,
rest_api
,
graphql_api
):
rest_prefix
=
'/rest/'
rest_api
.
setup_routes
(
app
,
rest_prefix
)
def
setup_routes
(
app
,
rest_api
s
,
graphql_api
):
for
chamber
,
rest_api
in
rest_apis
.
items
():
rest_api
.
setup_routes
(
app
,
'/rest/{}/'
.
format
(
chamber
)
)
graphql_prefix
=
'/graphql/'
graphql_api
.
setup_routes
(
app
,
graphql_prefix
)
...
...
@@ -51,8 +51,7 @@ def setup_routes(app, rest_api, graphql_api):
return
render_template
(
'index.html'
,
piwik
=
piwik
,
rest_api
=
rest_api
.
summary
,
rest_prefix
=
rest_prefix
,
rest_apis
=
{
k
:
v
.
summary
for
k
,
v
in
rest_apis
.
items
()
},
graphql_prefix
=
graphql_prefix
,
jobs
=
Job
.
query
.
all
()
)
parlapi/setup_app.py
View file @
c54b123f
...
...
@@ -19,8 +19,8 @@ def setup_app(name):
db
.
init_app
(
app
)
# Setup REST API
from
.rest.setup
import
setup_a
pi
as
setup
_rest_api
rest_api
=
setup
_rest_api
(
app
)
from
.rest.setup
import
setup_a
n_api
as
setup_an
_rest_api
an_rest_api
=
setup_an
_rest_api
(
app
)
# Setup GraphQL API
from
.graphql.setup
import
setup_api
as
setup_graphql_api
...
...
@@ -28,6 +28,6 @@ def setup_app(name):
# Setup routes
from
.routes
import
setup_routes
setup_routes
(
app
,
rest_api
,
graphql_api
)
setup_routes
(
app
,
{
'an'
:
an_rest_api
}
,
graphql_api
)
return
app
parlapi/static/chamber-an.png
0 → 100644
View file @
c54b123f
4.57 KB
parlapi/static/chamber-sen.png
0 → 100644
View file @
c54b123f
6.16 KB
parlapi/templates/index.html
View file @
c54b123f
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment