routing

Asp.net core default route

萝らか妹 提交于 2020-12-30 05:09:34
问题 Simplified Startup code: public void ConfigureServices(IServiceCollection services) { services.AddMvc(); } public void Configure(IApplicationBuilder app, IHostingEnvironment env) { app.UseMvc(routes => { routes.MapRoute( name: "default", template: "", defaults: new { controller = "Main", action = "Index" }); }); } After running application in Visual Studio 2015 I see in browser "localhost:xxx", but I don't see result of MainController.Index(). Just blank page. What did I miss? Update: Web

Laravel 6.0 - Custom email verification: temporarySignedRoute() URL not working with new route

巧了我就是萌 提交于 2020-12-08 10:42:51
问题 I'm trying to upgrade to Laravel 6 from 5.8. We're using a custom verification email Notification with the following code to get the verification URL: URL::temporarySignedRoute( 'verification.verify', Carbon::now()->addMinutes(60), [ 'id' => $notifiable->getKey(), ] ); This seems to generate an URL that does not work with the new route (check this), for example: http://host/email/verify/38?expires=1574602925&signature=4410c2230623619633be56d3641814cea3c77236bf8435cba88fc102a35d3dc4 I couldn't

Rails: how to set json format for redirect_to

邮差的信 提交于 2020-12-08 05:51:46
问题 How I can redirect not to html format but to json? I want smthing like this: redirect_to user_path(@user), format: :json But this doesn't work, I still redirected to html path. 回答1: I read apidock some more... It was quite simple. I just should specify format in path helper like this: redirect_to user_path(@user, format: :json) 回答2: The accepted answer (specifying format: :json in the redirect_to options) wasn't working for me in a Rails 5.2 API app; requests with an Accept: application/json