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 @@ ...@@ -10,7 +10,7 @@
{ {
"name": "Create wallet - success", "name": "Create wallet - success",
"request": { "request": {
"url": "http://localhost:5000/api/wallet/", "url": "http://localhost:5000/api/v1/wallet/",
"method": "POST", "method": "POST",
"header": [ "header": [
{ {
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
{ {
"name": "Create wallet - validation errors", "name": "Create wallet - validation errors",
"request": { "request": {
"url": "http://localhost:5000/api/wallet/", "url": "http://localhost:5000/api/v1/wallet/",
"method": "POST", "method": "POST",
"header": [ "header": [
{ {
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
{ {
"name": "Load wallet", "name": "Load wallet",
"request": { "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", "method": "GET",
"header": [ "header": [
{ {
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
{ {
"name": "Recover wallet", "name": "Recover wallet",
"request": { "request": {
"url": "http://localhost:5000/api/wallet/recover", "url": "http://localhost:5000/api/v1/wallet/recover",
"method": "POST", "method": "POST",
"header": [ "header": [
{ {
......
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
namespace Breeze.Api.Controllers namespace Breeze.Api.Controllers
{ {
[Route("api/[controller]")] [ApiVersion("1.0")]
[Route("api/v{version:apiVersion}/[controller]")]
public class NodeController : Controller public class NodeController : Controller
{ {
[Route("connect")] [Route("connect")]
......
...@@ -28,6 +28,8 @@ namespace Breeze.Api ...@@ -28,6 +28,8 @@ namespace Breeze.Api
// add serializers for NBitcoin objects // add serializers for NBitcoin objects
.AddJsonOptions(options => NBitcoin.JsonConverters.Serializer.RegisterFrontConverters(options.SerializerSettings)) .AddJsonOptions(options => NBitcoin.JsonConverters.Serializer.RegisterFrontConverters(options.SerializerSettings))
.AddControllers(services); .AddControllers(services);
services.AddApiVersioning();
} }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
......
{ {
"dependencies": { "dependencies": {
"Microsoft.AspNetCore.Mvc": "1.1.2", "Microsoft.AspNetCore.Mvc": "1.1.2",
"Microsoft.AspNetCore.Mvc.Versioning": "1.0.3",
"Microsoft.AspNetCore.Routing": "1.1.1", "Microsoft.AspNetCore.Routing": "1.1.1",
"Microsoft.AspNetCore.Server.IISIntegration": "1.1.1", "Microsoft.AspNetCore.Server.IISIntegration": "1.1.1",
"Microsoft.AspNetCore.Server.Kestrel": "1.1.1", "Microsoft.AspNetCore.Server.Kestrel": "1.1.1",
......
...@@ -11,7 +11,8 @@ using Stratis.Bitcoin; ...@@ -11,7 +11,8 @@ using Stratis.Bitcoin;
namespace Breeze.Wallet.Controllers namespace Breeze.Wallet.Controllers
{ {
[Route("api/[controller]")] [ApiVersion("1.0")]
[Route("api/v{version:apiVersion}/[controller]")]
public class WalletController : Controller public class WalletController : Controller
{ {
private readonly IWalletWrapper walletWrapper; private readonly IWalletWrapper walletWrapper;
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
"dependencies": { "dependencies": {
"HBitcoin": "0.1.5", "HBitcoin": "0.1.5",
"Microsoft.AspNetCore.Mvc.Versioning": "1.0.3",
"NBitcoin": "3.0.2.10", "NBitcoin": "3.0.2.10",
"NETStandard.Library": "1.6.1", "NETStandard.Library": "1.6.1",
"Stratis.Bitcoin": "1.0.1.2-alpha" "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