neuecc / lightnode Goto Github PK
View Code? Open in Web Editor NEWMicro RPC/REST Framework built on OWIN
Home Page: http://neuecc.github.io/LightNode
License: MIT License
Micro RPC/REST Framework built on OWIN
Home Page: http://neuecc.github.io/LightNode
License: MIT License
parameter send to form-encoded.
If not found, return 406 Not Acceptable
when content formatter failed, but stream start writes
cannot emit 500.
I found run glimpse on OWIN(only on Microsoft.Owin.Host.SystemWeb)
// through LightNode
app.MapWhen(x => !x.Request.Path.Value.StartsWith("/glimpse.axd", StringComparison.OrdinalIgnoreCase), x =>
{
x.UseLightNode();
});
// hacks, glimpse HttpModule handle end on PostReleaseRequestState
// but Microsoft.Owin.Host.SystemWeb not handle PostReleaseRequestState
// manualy call EndRequest
public class GlimpseHackMiddleware : OwinMiddleware
{
public GlimpseHackMiddleware(OwinMiddleware next)
: base(next)
{
}
public override Task Invoke(IOwinContext context)
{
var ctx = HttpContext.Current;
return Next.Invoke(context).ContinueWith(_ =>
{
(ctx.Application["__GlimpseRuntime"] as IGlimpseRuntime).EndRequest();
});
}
}
I make more glimpse information tab/timeline like Glimpse.Mvc.
should be OrdinalIgnoreCase
constructor injection?
Func<IEnumerable<string>, object> parseArray = xs =>
{
var result = new List<DateTime>();
foreach (var x in xs)
{
DateTime @out;
if (DateTime.TryParse(x, out @out)) result.Add(@out);
else return new DateTime[0];
}
return result.ToArray();
};
breaking change
use OWIN
WebAPI, ServiceStack, Nancy
octet stream, html, etc...
Has anyone looked into adding WebSocket support to LightNode? The WebSocket code for Owin is pretty straightforward. See here (or search GitHub for WebSocketSendAsync):
https://github.com/damianh/WebSocketsMiddleware
concept design
public class ValueProvider
{
// object is List[String] or String.
// optimize way, value is single in many cases.
Dictionary<string, object> values = new Dictionary<string, object>();
public ValueProvider(IDictionary<string, object> environment)
{
var queryString = "hoge=hage&huga=3";
foreach (var item in queryString.Split('&'))
{
// values.TryGetValue(
}
}
/// <summary>Returns List[String] or String or Null</summary>
public object GetValue(string key)
{
}
}
WebAPI example
config.IncludeErrorDetailPolicy = IncludeErrorDetailPolicy.Never;
{
Message:
ExceptionMessage:
ExceptionType:
StackTrace:
}
Service API doesn't allow overload, okay.
But helper methods can write oveload and currently failed.
can handle?
for the parse data manually
1.6.3でswaggerが素のHTMLで表示されてしまいます。
BOMを外したらちゃんと表示されるようです。
host
api/v1/a/b
api/v2/a/b
...
remove api/vs
API Test and Help pages use swagger. #8
http://swagger.io/
make output json schema(analyze .dll, same as T4 generation)
in mono, EventSource is not implemented yet.
We should provides ILogger and separating LightNode.EventSource
.
currently only supports POST
var v = typeof(MyClass).GetMethod("Hoge").GetParameters()[0];
Console.WriteLine(v.IsOptional);
Console.WriteLine(v.DefaultValue);
Parameter Binding to customizable
use AppDomain ShadowCopy?
see:Unit testing OWIN applications using TestServer
http://blogs.msdn.com/b/webdev/archive/2013/11/26/unit-testing-owin-applications-using-testserver.aspx
like ASP.NET Web API?
or no insterface???
abstract class LightNodeContract
{
public IDictionary<string, object> Environment
current implementation is very ugly
There platform don't have TypeBuilder therefore can't create proxy.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.