0

I have been trying to make a phaser game and port it to Tauri so I can have desktop apps, but I need a local web server. How cannot I do it without one?

Note: I need it to be LOCAL, I can't use tools like Replit or something to host it. (This is not a issue with tauri btw)

frigidus
  • 48
  • 7
  • 2
    I don't think you have the right tag, \[[tag:phaser]\] is about "a reusable synchronization barrier, similar in functionality to CyclicBarrier and CountDownLatch" in Java. I've updated it, is that javascript framework the one you're using? – cafce25 Jul 19 '23 at 21:12

1 Answers1

1

You don't really need a webserver (the webserver "prevent" the CORS security error, for local files), here are some alternatives you can use:

  1. Electron or nwjs as mentioned in this SO-Answer,
  2. Or simply inline all assets/files (as base64 blobs), like you would do for interactive game ads or so (similar as menitoned in this answer), than there would be only one big html-file, but you could open it also locally

But it depends on your actual usecase, if it should look like a standanlone app, option 1 is the way to go, BUT it is much more work (and needs much more space since it deploys it's own "webbrowser").
If bundling all assets/files into one single HTML file is enough, I would setup webpack(or another bunlder), like mentioned in the second option. Smaller footprint less work.

Update: Checkout neutralino.js, is a lightweight version of the above mentioned versions, here a comparison. (To take with a grain of salt, since it's from the github of neutralino.js and it's from 2018)

winner_joiner
  • 12,173
  • 4
  • 36
  • 61