blob: 41ce4366e5ac6c0c69fa70779f2b70749cb519b6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
using System;
using DSALib.Commands;
using DSALib.Models.Network;
using Microsoft.AspNetCore.Mvc;
namespace DSACore.Controllers {
public class ScribbleController : Controller {
[Route("[controller]")]
// GET: api/<controller>
[HttpGet]
public string Get() {
return "Usage: get /tokens/{Token}";
}
[HttpPost]
public string Post([FromBody] Command cmd) {
try {
return CommandHandler.ExecuteCommand(cmd).message;
}
catch (Exception e) {
return $"Ein Fehler ist aufgetreten: \n {e.Message}";
}
}
}
}
|