imperiojs / imperio

Javascript Mobile to Desktop Interaction Integration Library
https://www.imperiojs.com
160 stars 13 forks source link

Demo site #87

Closed jean-alain-re closed 8 years ago

jean-alain-re commented 8 years ago

How i can append the code to the URL. What is the format expected?

miblanchard commented 8 years ago

You can append either as a query string or as a parameter. So if you wanted to append as a query string you would add $nonce=abc12 (an example) to the end of your url. imperio can also handle request parameters if you define them in your express routes, ex. app.get('/duckhunt/:nonce', imperio.init(), next middleware...), the :nonce defines the request parameter that is available to our middleware. You don't need to worry about handling these in the middleware, that is what imperio does :), but for reference you can access queries via req.query[name] and parameters via req.params[name].

Also, you can provide your users with an input box and submit the code via POST as well. Hopefully that answers your question.

jean-alain-re commented 8 years ago

Is the demo is available from www.imperio.js. I launch this www.imperio.js on my desktop and i grab the code. Then, I launch this page on my mobile and it waits this code. Except, there is anything which indicates how we can add this code into the URL. I try www.imperio.js?code=CODE or www.imperio.js?nonce=CODE, but nothing.

Can you add the link on the generated code to try this library? thanks

miblanchard commented 8 years ago

The example site is www.imperiojs.com if you visit www.imperiojs.com on the desktop you would then visit imperiojs.com/[CODE] on your mobile device and you will be connected.

What link are you looking for?

jean-alain-re commented 8 years ago

Thanks for the help. Nice, I like this library :)

To be more plain, a link next to of the code to explain how we connect with the device.