После развертывания моего приложения на Google App Engine все работает как шарм, я могу получить доступ ко всем страницам, но когда я обновляюсь, я получаю ошибку 404
Пример: при обновлении https://my-app...appspot.com/create-ad бросить 404 не найдено
Я пробовал маршруты Angular 6, которых нет в Google App Engine и Как настроить Google App Engine yaml для обработки ошибки 404, но с тем же результатом
Это в моем app.yml
runtime: python27
api_version: 1
threadsafe: true
handlers:
- url: /
static_files: dist/index.html
upload: dist/index.html
- url: /
static_dir: dist
- url: /.*
static_files: dist/index.html
upload: dist/index.html
skip_files:
- ^.*node_modules(/.*)?
- ^.*json_data(/.*)?
- ^.*e2e(/.*)?
а также попробовал эту конфигурацию app.yml для перенаправления всего URL-адреса на index.html
runtime: python27
api_version: 1
threadsafe: false
service: frontend-accept
handlers:
- url: /
static_files: dist/index.html
upload: dist/index.html
- url: /
static_dir: dist
- url: /.*
script: main.py
skip_files:
- ^.*node_modules(/.*)?
- ^.*json_data(/.*)?
- ^.*e2e(/.*)?
это мой main.py
import webapp2
app = webapp2.WSGIApplication()
class RedirectToHome(webapp2.RequestHandler):
def get(self, path):
self.redirect('/dist/index.html')
routes = [
RedirectRoute('/<path:.*>', RedirectToHome),
]
for r in routes:
app.router.add(r)
Но всегда получаю 404 при обновлении страницы
Любая помощь? Спасибо