mirror of
https://github.com/ckaczor/HomeMonitor.git
synced 2026-02-08 09:38:28 -05:00
Update REST endpoints
This commit is contained in:
@@ -3,40 +3,15 @@ using System.Collections.Generic;
|
|||||||
|
|
||||||
namespace ChrisKaczor.HomeMonitor.Hub.Service.Controllers
|
namespace ChrisKaczor.HomeMonitor.Hub.Service.Controllers
|
||||||
{
|
{
|
||||||
[Route("api/[controller]")]
|
[Route("[controller]")]
|
||||||
[ApiController]
|
[ApiController]
|
||||||
public class ValuesController : ControllerBase
|
public class ValuesController : ControllerBase
|
||||||
{
|
{
|
||||||
// GET api/values
|
// GET values
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public ActionResult<IEnumerable<string>> Get()
|
public ActionResult<IEnumerable<string>> Get()
|
||||||
{
|
{
|
||||||
return new[] { "value1", "value2" };
|
return new[] { "value1", "value2" };
|
||||||
}
|
}
|
||||||
|
|
||||||
// GET api/values/5
|
|
||||||
[HttpGet("{id}")]
|
|
||||||
public ActionResult<string> Get(int id)
|
|
||||||
{
|
|
||||||
return "value";
|
|
||||||
}
|
|
||||||
|
|
||||||
// POST api/values
|
|
||||||
[HttpPost]
|
|
||||||
public void Post([FromBody] string value)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
// PUT api/values/5
|
|
||||||
[HttpPut("{id}")]
|
|
||||||
public void Put(int id, [FromBody] string value)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
// DELETE api/values/5
|
|
||||||
[HttpDelete("{id}")]
|
|
||||||
public void Delete(int id)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
"IIS Express": {
|
"IIS Express": {
|
||||||
"commandName": "IISExpress",
|
"commandName": "IISExpress",
|
||||||
"launchBrowser": true,
|
"launchBrowser": true,
|
||||||
"launchUrl": "api/values",
|
"launchUrl": "values",
|
||||||
"environmentVariables": {
|
"environmentVariables": {
|
||||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
}
|
}
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
"Service": {
|
"Service": {
|
||||||
"commandName": "Project",
|
"commandName": "Project",
|
||||||
"launchBrowser": true,
|
"launchBrowser": true,
|
||||||
"launchUrl": "api/values",
|
"launchUrl": "values",
|
||||||
"applicationUrl": "http://localhost:5000",
|
"applicationUrl": "http://localhost:5000",
|
||||||
"environmentVariables": {
|
"environmentVariables": {
|
||||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ spec:
|
|||||||
rules:
|
rules:
|
||||||
- http:
|
- http:
|
||||||
paths:
|
paths:
|
||||||
- path: "/hub"
|
- path: "/api/hub"
|
||||||
backend:
|
backend:
|
||||||
serviceName: hub-service
|
serviceName: hub-service
|
||||||
servicePort: 80
|
servicePort: 80
|
||||||
@@ -3,7 +3,7 @@ using System.Collections.Generic;
|
|||||||
|
|
||||||
namespace ChrisKaczor.HomeMonitor.Weather.Service.Controllers
|
namespace ChrisKaczor.HomeMonitor.Weather.Service.Controllers
|
||||||
{
|
{
|
||||||
[Route("api/[controller]")]
|
[Route("[controller]")]
|
||||||
[ApiController]
|
[ApiController]
|
||||||
public class ValuesController : ControllerBase
|
public class ValuesController : ControllerBase
|
||||||
{
|
{
|
||||||
@@ -12,20 +12,5 @@ namespace ChrisKaczor.HomeMonitor.Weather.Service.Controllers
|
|||||||
{
|
{
|
||||||
return new[] { "value1", "value2" };
|
return new[] { "value1", "value2" };
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet("{id}")]
|
|
||||||
public ActionResult<string> Get(int id)
|
|
||||||
{
|
|
||||||
return "value";
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpPost]
|
|
||||||
public void Post([FromBody] string value) { }
|
|
||||||
|
|
||||||
[HttpPut("{id}")]
|
|
||||||
public void Put(int id, [FromBody] string value) { }
|
|
||||||
|
|
||||||
[HttpDelete("{id}")]
|
|
||||||
public void Delete(int id) { }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
"profiles": {
|
"profiles": {
|
||||||
"Service": {
|
"Service": {
|
||||||
"commandName": "Project",
|
"commandName": "Project",
|
||||||
"launchUrl": "api/values",
|
"launchUrl": "values",
|
||||||
"environmentVariables": {
|
"environmentVariables": {
|
||||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -124,3 +124,21 @@ spec:
|
|||||||
nodeSelector:
|
nodeSelector:
|
||||||
kubernetes.io/hostname: kubernetes
|
kubernetes.io/hostname: kubernetes
|
||||||
schedulerName: default-scheduler
|
schedulerName: default-scheduler
|
||||||
|
---
|
||||||
|
kind: Ingress
|
||||||
|
apiVersion: extensions/v1beta1
|
||||||
|
metadata:
|
||||||
|
name: weather
|
||||||
|
namespace: home-monitor
|
||||||
|
annotations:
|
||||||
|
kubernetes.io/ingress.class: traefik
|
||||||
|
nginx.ingress.kubernetes.io/ssl-redirect: 'false'
|
||||||
|
traefik.frontend.rule.type: PathPrefixStrip
|
||||||
|
spec:
|
||||||
|
rules:
|
||||||
|
- http:
|
||||||
|
paths:
|
||||||
|
- path: "/api/weather"
|
||||||
|
backend:
|
||||||
|
serviceName: weather-service
|
||||||
|
servicePort: 80
|
||||||
Reference in New Issue
Block a user