Skip to content
This repository was archived by the owner on Feb 6, 2020. It is now read-only.

Register resources by POST #19

Closed
mstade opened this issue Aug 24, 2014 · 1 comment
Closed

Register resources by POST #19

mstade opened this issue Aug 24, 2014 · 1 comment

Comments

@mstade
Copy link
Collaborator

mstade commented Aug 24, 2014

So I'm reading up more on CoAP, and the more I read the more I go "dayum girl, 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.

@mstade
Copy link
Collaborator Author

mstade commented Sep 22, 2015

This issue was moved to websdk/nap#8

@mstade mstade closed this as completed Sep 22, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant