3 ms·
I tried some experiments earlier this year with radically simpler RPC calling conventions. It's called NSOAP, and is available for express, koa and React. It ge
by jeswin 9y ago
I tried some experiments earlier this year with radically simpler RPC calling conventions. It's called NSOAP, and is available for express, koa and React. It gets rid of HTTP verbs and treats the url like code. https://github.com/nsoap-official/nsoap-express https://github.com/nsoap-official/nsoap-express
Some examples.
//Adds two numbers
http://www.example.com/addTwoNumbers(10,20)
//String arguments
http://www.example.com/search(thomas)
//Parameters
http://www.example.com/math.square(x)?x=20
//Chaining
http://www.example.com/getCustomer(100).getAccounts(2017)
- TheRealPomax 9y agoWhile on the surface that might seem like a workable idea, getting input validation right is going to require more syntax (making it far less clean). Specifically, URLs are only ever string data, so without type annotation everything is strings, even if it looks like a number, array, or even more complex data type.
- jeswin 9y ago> While on the surface that might seem like a workable idea, getting input validation right is going to require more syntax (making it far less clean) Input validation will go into the router, which I have created for Express, Koa and React. Application code will not have to deal with validation or parsing. > Specifically, URLs are only ever string data, so without type annotation everything is strings, even if it looks like a number, array, or even more complex data type. You'd have to pass more complex data types either in body (as JSON) or as parameters with quoting. Current router does however, infer types to the extent of: //Params inferred as string, number, boolean and number. curl "http://www.example.com/search(Jeswin,20,true,x)?x=100"
- eppsilon 9y agoLooks a little bit like OData, at least the querying parts.