Commit 7dcaa7b5 authored by Jeremy Bokobza's avatar Jeremy Bokobza Committed by GitHub

Added versioning (#5)

* Rename Safe to Wallet

* Added versioning to the Api
parent d3b95586
......@@ -10,7 +10,7 @@
{
"name": "Create wallet - success",
"request": {
"url": "http://localhost:5000/api/wallet/",
"url": "http://localhost:5000/api/v1/wallet/",
"method": "POST",
"header": [
{
......@@ -30,7 +30,7 @@
{
"name": "Create wallet - validation errors",
"request": {
"url": "http://localhost:5000/api/wallet/",
"url": "http://localhost:5000/api/v1/wallet/",
"method": "POST",
"header": [
{
......@@ -50,7 +50,7 @@
{
"name": "Load wallet",
"request": {
"url": "http://localhost:5000/api/wallet/?password=123456&folderPath=MyWallets&name=myFirstWallet",
"url": "http://localhost:5000/api/v1/wallet/?password=123456&folderPath=MyWallets&name=myFirstWallet",
"method": "GET",
"header": [
{
......@@ -70,7 +70,7 @@
{
"name": "Recover wallet",
"request": {
"url": "http://localhost:5000/api/wallet/recover",
"url": "http://localhost:5000/api/v1/wallet/recover",
"method": "POST",
"header": [
{
......
......@@ -2,7 +2,8 @@
namespace Breeze.Api.Controllers
{
[Route("api/[controller]")]
[ApiVersion("1.0")]
[Route("api/v{version:apiVersion}/[controller]")]
public class NodeController : Controller
{
[Route("connect")]
......
......@@ -28,6 +28,8 @@ namespace Breeze.Api
// add serializers for NBitcoin objects
.AddJsonOptions(options => NBitcoin.JsonConverters.Serializer.RegisterFrontConverters(options.SerializerSettings))
.AddControllers(services);
services.AddApiVersioning();
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
......
{
"dependencies": {
"Microsoft.AspNetCore.Mvc": "1.1.2",
"Microsoft.AspNetCore.Mvc.Versioning": "1.0.3",
"Microsoft.AspNetCore.Routing": "1.1.1",
"Microsoft.AspNetCore.Server.IISIntegration": "1.1.1",
"Microsoft.AspNetCore.Server.Kestrel": "1.1.1",
......
......@@ -11,7 +11,8 @@ using Stratis.Bitcoin;
namespace Breeze.Wallet.Controllers
{
[Route("api/[controller]")]
[ApiVersion("1.0")]
[Route("api/v{version:apiVersion}/[controller]")]
public class WalletController : Controller
{
private readonly IWalletWrapper walletWrapper;
......
......@@ -3,6 +3,7 @@
"dependencies": {
"HBitcoin": "0.1.5",
"Microsoft.AspNetCore.Mvc.Versioning": "1.0.3",
"NBitcoin": "3.0.2.10",
"NETStandard.Library": "1.6.1",
"Stratis.Bitcoin": "1.0.1.2-alpha"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment