Can't spawn an http server from node.js inside javet
See original GitHub issueI have a main.js file with this code:
const express = require("express");
const app = express();
app.listen(3000, "0.0.0.0", () => {
console.log(`Running server`);
});
And from java I’m doing this:
V8Host v8Host = V8Host.getNodeInstance();
V8Runtime v8 = v8Host.createV8Runtime();
v8.getExecutor(new File("main.js")).execute();
Scanner in = new Scanner(System.in);
System.out.println("running server, press enter stop");
in.nextLine();
I dont get any errors but the server never starts either.
Issue Analytics
- State:
- Created 2 years ago
- Comments:34 (18 by maintainers)
Top Results From Across the Web
Node.js HTTP Server Child Process Won't Be Killed in Node.js
I have used exec instead of spawn originally. I tried using SIGTERM and SIGINT , but I have had no luck. The child...
Read more >How To Create a Web Server in Node.js with the HTTP Module
In this tutorial, you will learn how to build web servers using the http module that's included in Node.js. You will build web...
Read more >Child process | Node.js v19.3.0 Documentation
The node:child_process module provides the ability to spawn subprocesses in a manner that is similar, but not identical, to popen(3) .
Read more >Node.js Child Processes: Everything you need to know
The spawn function launches a command in a new process and we can use it to pass that command any arguments. For example,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks I just tried it and I can confirm it works, great job 👍
Wonderful! Thank you for the great help!