summaryrefslogtreecommitdiff
path: root/DSACore/Controllers/LobbyController.cs
blob: a94618491de3c3bbfe23ac17327003fcc6046ea0 (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
26
27
28
29
30
31
32
using DSACore.Models.Network;
using System;
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 Commands.CommandHandler.ExecuteCommand(cmd).message;
            }
            catch (Exception e)
            {
                return $"Ein Fehler ist aufgetreten: \n {e.Message}";
            }
            
        } 
        
    }
}