{"id":26702934,"url":"https://github.com/springhgui/routerhistory","last_synced_at":"2025-04-13T12:12:24.715Z","repository":{"id":112565677,"uuid":"489981899","full_name":"SpringHgui/RouterHistory","owner":"SpringHgui","description":"用于Vue单页面应用，使用VueRouter的History模式下，通过AspNetCore提供文件服务。","archived":false,"fork":false,"pushed_at":"2025-03-26T05:47:31.000Z","size":807,"stargazers_count":13,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-13T12:12:19.440Z","etag":null,"topics":["aspnetcore","history","vue","vue-router","vuerouter"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SpringHgui.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2022-05-08T15:28:14.000Z","updated_at":"2025-03-26T05:47:35.000Z","dependencies_parsed_at":"2024-05-10T04:25:30.379Z","dependency_job_id":"2a0951d7-e7ab-466e-afda-5b6cb1010969","html_url":"https://github.com/SpringHgui/RouterHistory","commit_stats":null,"previous_names":["springhgui/routerhistory"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpringHgui%2FRouterHistory","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpringHgui%2FRouterHistory/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpringHgui%2FRouterHistory/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpringHgui%2FRouterHistory/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SpringHgui","download_url":"https://codeload.github.com/SpringHgui/RouterHistory/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248710448,"owners_count":21149191,"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":["aspnetcore","history","vue","vue-router","vuerouter"],"created_at":"2025-03-27T03:17:52.954Z","updated_at":"2025-04-13T12:12:24.679Z","avatar_url":"https://github.com/SpringHgui.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RouterHistory\n[![Nuget](https://img.shields.io/nuget/v/RouterHistory)](https://www.nuget.org/packages/RouterHistory/)\n\n用于单页面应用，使用History模式下，通过AspNetCore提供文件服务。\n\n# 使用\n1. 使用nuget安装`RouterHistory`包\n2. 在`app.UseRouting`,`app.MapControllers`和`app.UseStaticFiles()` 之后添加`app.UseRouterHistory();`，以提供性能。\n\n```c#\n // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.\npublic void Configure(IApplicationBuilder app, IWebHostEnvironment env)\n{\n    if (env.IsDevelopment())\n    {\n        app.UseDeveloperExceptionPage();\n    }\n    else\n    {\n        app.UseExceptionHandler(\"/Home/Error\");\n        // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.\n        app.UseHsts();\n    }\n    app.UseHttpsRedirection();\n\n    app.UseStaticFiles();\n\n    app.UseRouting();\n    \n    // 添加这一行即可\n    app.UseRouterHistory();\n\n    app.UseAuthorization();\n\n    app.UseEndpoints(endpoints =\u003e\n    {\n        endpoints.MapControllerRoute(\n            name: \"default\",\n            pattern: \"{controller=Home}/{action=Index}/{id?}\");\n    });\n}\n```\n3. 将编译后的文件放到`wwwroot`目录内\n4. 开始体验吧。\n\n# 遇到问题\n请提交[issue](https://github.com/SpringHgui/RouterHistory/issues/new)给作者\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspringhgui%2Frouterhistory","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspringhgui%2Frouterhistory","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspringhgui%2Frouterhistory/lists"}