Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Register resources by POST #8

Open
mstade opened this issue Sep 22, 2015 · 0 comments
Open

Register resources by POST #8

mstade opened this issue Sep 22, 2015 · 0 comments

Comments

@mstade
Copy link
Member

mstade commented Sep 22, 2015

From @mstade on August 24, 2014 0:36

So I'm reading up more on CoAP, and the more I read the more I go "dayum, you hella fine!" As I was reading up on the CoRE link format, I came across this little gem:

The CoRE Link Format can be used by a server to register resources
with a resource directory or to allow a resource directory to poll
for resources. Resource registration can be achieved by having each
server POST their resources to "/.well-known/core" on the resource
directory. This, in turn, adds links to the resource directory under
an appropriate resource. These links can then be discovered by any
client by making a request to a resource directory lookup interface.

Basically, instead of doing this:

web.resource('/foo/bar/{baz}', handler)

We could do something like this:

request({ uri: '/.well-known/nap', method: 'post', body: { uri: '/foo/bar/{baz}', server: handler } })

Well batman -- you might say -- what's the benefit to this? For one, we might not have a reference to web, instead we might just have a reference to the request function (as in the above example.) For another, it's a bit more dog-foody and as well, we could enable interesting things such as GET /.well-known/nap for resource discovery, traversal etc. I need to read up more on CoRE to understand things a bit better, but I kind of like this idea so dumping it here for further review and stuff.

Copied from original issue: sammyt/nap#19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant