Linking Hashlink and other targets to the role of a webserver.
class Main {
function main() {
var app = new weblink.Weblink();
app.get(function(request,response)
{
response.send("HELLO WORLD");
});
app.listen(2000);
}
}
Install dev version:
haxelib git weblink https://github.com/PXshadow/weblink
Include in build.hxml
-lib weblink
requires libuv (asys in the future)
Configure VSCode :
Add that in .vscode/launch.json :
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "HashLink (launch)",
"request": "launch",
"type": "hl",
"cwd": "${workspaceFolder}",
"preLaunchTask": {
"type": "haxe",
"args": "active configuration"
}
},
{
"name": "HashLink (attach)",
"request": "attach",
"port": 6112,
"type": "hl",
"cwd": "${workspaceFolder}",
"preLaunchTask": {
"type": "haxe",
"args": "active configuration"
}
}
]
}