0

I am developing a website using Flask and Flask Restplus. I tried to use Google App Engine to deploy the app, however when I run dev_appserver.py on my computer, all the swagger-ui files cannot be found. I have no ideas why this happens? Can anyone tell me how to solve this?

Here is the example logs 404 for the resource:

INFO     2017-06-14 04:21:52,859 module.py:809] default: "GET /api/ HTTP/1.1" 200 3710
INFO     2017-06-14 04:21:53,113 module.py:809] default: "GET /swaggerui/bower/swagger-ui/dist/css/screen.css HTTP/1.1" 404 233
INFO     2017-06-14 04:21:53,113 module.py:809] default: "GET /swaggerui/bower/swagger-ui/dist/lib/jquery.slideto.min.js HTTP/1.1" 404 233
INFO     2017-06-14 04:21:53,115 module.py:809] default: "GET /swaggerui/bower/swagger-ui/dist/lib/object-assign-pollyfill.js HTTP/1.1" 404 233
INFO     2017-06-14 04:21:53,121 module.py:809] default: "GET /swaggerui/bower/swagger-ui/dist/css/typography.css HTTP/1.1" 404 233
Hà Link
  • 367
  • 1
  • 6
  • 20

1 Answers1

0

You need to put swaggerui inside your project. I suggest making a libs directory at the root of your project (same level as app.yaml).

Then, use GAE's vendoring method. To use vendoring, create (or modify) appengine_config.py in the root of your project, as follows:

from google.appengine.ext import vendor

# Add 3rd party libraries in the "libs" folder.
vendor.add('libs')
GAEfan
  • 11,244
  • 2
  • 17
  • 33
  • I push my code to google cloud app engine and it worked with swagger ui, but my dev app server always return 404 for swagger ui. I'm not sure if there is something wrong with my gcloud installation in my local environment. – Hà Link Jun 15 '17 at 04:19