How to add https to love.js
- Gunroar:Cannon()
- Party member
- Posts: 1150
- Joined: Thu Dec 10, 2020 1:57 am
How to add https to love.js
It seems like something that would be easy to do but I have trouble doing. I'm using Makelove to make the project, and luahttps as a native file won't work with web, but I believe is should be able to somehow allow Lua to make https calls.
Re: How to add https to love.js
I think the support is going to be included in v12.

- Gunroar:Cannon()
- Party member
- Posts: 1150
- Joined: Thu Dec 10, 2020 1:57 am
Re: How to add https to love.js
Yes, I know. And I've also successfully built versions without needing 12. I was asking AI and it said that I had to expose a module variable that can call the API in a script tag of the html file, to Lua.
- Gunroar:Cannon()
- Party member
- Posts: 1150
- Joined: Thu Dec 10, 2020 1:57 am
Re: How to add https to love.js
like it how isn't there a way to expose javascript functions or variables to the global namespace lua for love.js somehow?
- Gunroar:Cannon()
- Party member
- Posts: 1150
- Joined: Thu Dec 10, 2020 1:57 am
Re: How to add https to love.js
I'm away from my coding environment right now, but here's how AI said I could go about it:
Code: Select all
// Exposing a JavaScript function to Lua
lovejs.bindGlobal("myJsFunction", function() {
console.log("This is a JavaScript function!");
return "Hello from JavaScript!";
});
Re: How to add https to love.js
You need to use another library. The Love.js-Api-Player does what you need. It also has an example and tips for using it with Davidobot love.js fork, that makelove is using.
Who is online
Users browsing this forum: No registered users and 0 guests