Update REST endpoints

This commit is contained in:
2019-08-03 08:36:57 -04:00
parent 561ba17048
commit e0ecb2a285
6 changed files with 26 additions and 48 deletions

View File

@@ -3,7 +3,7 @@ using System.Collections.Generic;
namespace ChrisKaczor.HomeMonitor.Weather.Service.Controllers
{
[Route("api/[controller]")]
[Route("[controller]")]
[ApiController]
public class ValuesController : ControllerBase
{
@@ -12,20 +12,5 @@ namespace ChrisKaczor.HomeMonitor.Weather.Service.Controllers
{
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) { }
}
}

View File

@@ -3,7 +3,7 @@
"profiles": {
"Service": {
"commandName": "Project",
"launchUrl": "api/values",
"launchUrl": "values",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},

View File

@@ -123,4 +123,22 @@ spec:
dnsPolicy: ClusterFirst
nodeSelector:
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