Repository contains ready to use preconfigured project to create fully functional production ready RESTful services.
Note! If you are looking for a .Net Core project template, please, check out the project ASP.Net Core RESTful Service Project Template.
The template uses the 4.7.1 version of .Net Framework. Make sure that you have it installed before use the template.
Contains
- CORS enabled
- preconfigured HTTP OPTIONS handler
- Cache-Control header preconfigured
- Autofac as a DI-container
- Content formatter configured to use Json.Net
- AutoMapper
- Unhandled exceptions handler
- Unhandled exceptions logger
- Serilog as a default logger preconfigured to save logs to %AppData%/Logs folder
- Swagger for API documentation
- JWT-Bearer authentication to protect your API with IdentityModel
- Ability to use environment variables in configuration options (web.config)
- Support .env files to easy switching between different environments (DotNetEnv)
- ... and some other boilerplate code
Getting Started
- Make sure you have the .Net Framework v4.7.1 installed
- Install the extension from the Visual Studio Marketplace or download and install the latest version from the GitHub. Also, you can install it from Visual Studio. To do so click on "Tools/Extensions and Updates..." menu item, then select "Online/Visual Studio Marketplace/Templates" on the left pane, search for "ASP.Net WebAPI Application Project Template," select it and click "Download" button.
- Restart Visual Studio
- Click on "File/New Project..." menu item
- Type "webapi" on the right pane
- Select "APS.Net WebAPI Application With OWIN" and click OK button.
- Run the service
- Open a browser and navigate to http://localhost:5000/swagger/ui/index to see API documentation
- Play around with the API
Visit project Wiki pages to learn more about the template.
Any suggestions and bug reports are very appeciated.