{"id":20172625,"url":"https://github.com/igorrendulic/appengineangularjsweb","last_synced_at":"2025-03-03T04:40:52.263Z","repository":{"id":115791815,"uuid":"93881688","full_name":"igorrendulic/AppengineAngularJSWeb","owner":"igorrendulic","description":"Appengine and AngularJS Reloading angular page using ng-route in html5","archived":false,"fork":false,"pushed_at":"2018-10-29T19:21:33.000Z","size":100,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-13T15:51:44.965Z","etag":null,"topics":["404","angular","appengine","ng-route","refresh","url-rewrite"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/igorrendulic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-06-09T17:27:06.000Z","updated_at":"2018-10-29T19:21:34.000Z","dependencies_parsed_at":"2023-12-06T02:15:12.015Z","dependency_job_id":null,"html_url":"https://github.com/igorrendulic/AppengineAngularJSWeb","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igorrendulic%2FAppengineAngularJSWeb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igorrendulic%2FAppengineAngularJSWeb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igorrendulic%2FAppengineAngularJSWeb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igorrendulic%2FAppengineAngularJSWeb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/igorrendulic","download_url":"https://codeload.github.com/igorrendulic/AppengineAngularJSWeb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241610977,"owners_count":19990505,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["404","angular","appengine","ng-route","refresh","url-rewrite"],"created_at":"2024-11-14T01:31:39.178Z","updated_at":"2025-03-03T04:40:52.246Z","avatar_url":"https://github.com/igorrendulic.png","language":"Shell","readme":"# Google Appengine AngularJS Example ng-Route avoid 404 on Refresh\n\nFrom the [Angular Docs](https://docs.angularjs.org/guide/$location) using `$location` with ng-route can have problems loading pages when refreshing the relative link, e.g. /about.  \n```\nUsing this mode requires URL rewriting on server side, basically you have to rewrite all your links to entry point of your application (e.g. index.html). Requiring a \u003cbase\u003e tag is also important for this case, as it allows AngularJS to differentiate between the part of the url that is the application base and the path that should be handled by the application.\n```\n\nThe reason this happens is when you first visit the page (`/about`) the index page wasn't loaded so ng-route has no way of knowing you need to have a `main` page loaded first and route to links from there. \n\nThis is a simple example that solves this problem the right way.\n\nThe solution is in `main.py` class.\n\n```\nclass RefreshPageHandler(webapp2.RequestHandler):\n    def get(self, path):\n        template_values = {}\n    \ttemplate = JINJA_ENVIRONMENT.get_template('app/index.html')\n        self.response.write(template.render(template_values))\n\nAPP = webapp2.WSGIApplication([\n    ('/(.*)', RefreshPageHandler),\n], debug=True)\n```\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Figorrendulic%2Fappengineangularjsweb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Figorrendulic%2Fappengineangularjsweb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Figorrendulic%2Fappengineangularjsweb/lists"}