Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nomad-FAIR
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nomad-lab
nomad-FAIR
Commits
1f362c58
Commit
1f362c58
authored
6 years ago
by
Markus Scheidgen
Browse files
Options
Downloads
Patches
Plain Diff
Moved wsgi config to app.
parent
aea340bf
No related branches found
No related tags found
No related merge requests found
Pipeline
#41244
passed
6 years ago
Stage: build
Stage: test
Stage: release
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
nomad/api/__main__.py
+0
-10
0 additions, 10 deletions
nomad/api/__main__.py
nomad/api/app.py
+12
-0
12 additions, 0 deletions
nomad/api/app.py
with
12 additions
and
10 deletions
nomad/api/__main__.py
+
0
−
10
View file @
1f362c58
...
@@ -12,20 +12,10 @@
...
@@ -12,20 +12,10 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
from
werkzeug.wsgi
import
DispatcherMiddleware
from
nomad.api
import
app
from
nomad.api
import
app
from
nomad
import
config
def
run_dev_server
(
*
args
,
**
kwargs
):
def
run_dev_server
(
*
args
,
**
kwargs
):
def
simple
(
env
,
resp
):
resp
(
b
'
200 OK
'
,
[(
b
'
Content-Type
'
,
b
'
text/plain
'
)])
return
[
(
'
Development nomad api server. Api is served under %s/.
'
%
config
.
services
.
api_base_path
).
encode
(
'
utf-8
'
)]
app
.
wsgi_app
=
DispatcherMiddleware
(
simple
,
{
config
.
services
.
api_base_path
:
app
.
wsgi_app
})
app
.
run
(
*
args
,
**
kwargs
)
app
.
run
(
*
args
,
**
kwargs
)
...
...
This diff is collapsed.
Click to expand it.
nomad/api/app.py
+
12
−
0
View file @
1f362c58
...
@@ -20,6 +20,7 @@ from flask import Flask, jsonify
...
@@ -20,6 +20,7 @@ from flask import Flask, jsonify
from
flask_restplus
import
Api
from
flask_restplus
import
Api
from
flask_cors
import
CORS
from
flask_cors
import
CORS
from
werkzeug.exceptions
import
HTTPException
from
werkzeug.exceptions
import
HTTPException
from
werkzeug.wsgi
import
DispatcherMiddleware
import
os.path
import
os.path
from
nomad
import
config
from
nomad
import
config
...
@@ -38,6 +39,17 @@ app.config.setdefault('RESTPLUS_MASK_HEADER', False)
...
@@ -38,6 +39,17 @@ app.config.setdefault('RESTPLUS_MASK_HEADER', False)
app
.
config
.
setdefault
(
'
RESTPLUS_MASK_SWAGGER
'
,
False
)
app
.
config
.
setdefault
(
'
RESTPLUS_MASK_SWAGGER
'
,
False
)
def
api_base_path_response
(
env
,
resp
):
resp
(
b
'
200 OK
'
,
[(
b
'
Content-Type
'
,
b
'
text/plain
'
)])
return
[
(
'
Development nomad api server. Api is served under %s/.
'
%
config
.
services
.
api_base_path
).
encode
(
'
utf-8
'
)]
app
.
wsgi_app
=
DispatcherMiddleware
(
api_base_path_response
,
{
config
.
services
.
api_base_path
:
app
.
wsgi_app
})
CORS
(
app
)
CORS
(
app
)
api
=
Api
(
api
=
Api
(
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment