Advertisement
SY573M_404

Untitled

Jun 1st, 2023
1,346
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (async () => {
  2.   const http = await import("http");
  3.   const open = (await import("open")).default;
  4.  
  5.   const url = "http://localhost:3000";
  6.  
  7.   const interval = setInterval(() => {
  8.     http.get(url, () => {
  9.       open(url).then(() => {
  10.         clearInterval(interval);
  11.       });
  12.     })
  13.     .on("error", () => {
  14.       console.log("Web server is not ready yet");
  15.     });
  16.   }, 1000);
  17. })()
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement