smoke icon indicating copy to clipboard operation
smoke copied to clipboard

Does it run on the browser? How to?

Open pbeltranl opened this issue 4 years ago • 2 comments

Hi,

I've built smoke with browserify to run it on the browser (latest version of Chrome). This part seems ok since all the objects are created with no errors.

However, after the app.listen(9999) instruction nothing happens. No TCP port opened. No log traces either anywhere.

Below is the example used for testing this:

#>>>>>>>>>>>>>>> var _smokeNode = require("smoke-node");

const host = new _smokeNode.Node();

const app = host.rest.createServer()

app.get('/', async (req, res) => {

res.headers['Content-Type'] = 'text/html'

res.send("<h1>hello world</h1>");

})

app.listen(9999) <<<<<<<<<<<<<<<<<<

What are the recommended steps to run it on the browser?

Thanks, Pablo

pbeltranl avatar Mar 13 '22 12:03 pbeltranl

change the client port

const resp = await node.rest.fetch(`rest://${await host.address()}:9999/`).then((r) => r.text());

shynome avatar Jun 10 '22 15:06 shynome

may i ask a question? how to build smoke with browserify?

szcuipeng avatar Oct 23 '22 09:10 szcuipeng

Wooo that is naaaa

Terence39 avatar Jan 12 '24 14:01 Terence39

Hiya,

Going to close this issue off as it's stale. This project has been overhauled and can now be installed via.

$ npm install @sinclair/smoke

It should run in Chrome and Firefox. Safari support may be hit or miss however. Cheers S

sinclairzx81 avatar Mar 29 '24 16:03 sinclairzx81