Пример #1
0
        public ApiModule(IDataStore data)
            : base("/api")
        {
            _Data = data;

            Get["/messages/list"] = p => Response.AsJson(_Data.GetMessages());

            Post["/messages/save"] = p => { _Data.AddMessage(Request.Form["Message"]); return "OK!"; };
        }