0

All routes in .NET Core are starting with /api for example:

/api/store

Which I want to be just:

/store

In older verions of the framework I could edit this in the web.config...does anyone know where that configuration lives now?

5
  • 5
    It was never in the web.config, it's in the routing config. It's not hard to find.... Commented Feb 20, 2017 at 15:47
  • depends on how you set up routing. It could be an attribute on the controller itself, or it could be in the Startup area, where routes can be registered Commented Feb 20, 2017 at 15:48
  • I'd rather have it in the controller Commented Feb 20, 2017 at 15:48
  • You get to put it where ever you want :) Commented Feb 20, 2017 at 15:49
  • wow i didnt see the route tag with "api" Commented Feb 20, 2017 at 15:49

1 Answer 1

1

Use attribute [Route("/store/{youraction}")] or create new MapRoute in Startup.cs (Configure section)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.