I have a Neko web server that is supposed to run main.n
when I do nekotools server
. But when I navigate to localhost:2000
all I get in response is this:
I have a folder called html
and in it contains one file index.mtt
which contains the following text:
<html>
<head>
<title>Neko Tutorial</title>
</head>
<body>
<h1>Hello, there ::name::!</h1>
</body>
</html>
Wow, discourse really does not like HTML tags in pre-formatted text! But regardless, that’s what my HTML page looks like.
I then have an src
folder containing Main.hx
with the following code:
package;
import sys.db.Types;
import sys.io.File;
import haxe.Template;
class Main
{
public static function main()
{
var str = haxe.Resource.getString("index");
var t = new Template(str);
var output = t.execute({ name: "tienery" });
trace(output);
}
}
I then have my run.bat
- haxe -cp src/ -neko main.n -main Main -resource html/index.mtt@index
When I run it, Haxe does not throw any errors and compiles successfully, giving me back main.n
in the root folder. But as mentioned, nekotools server
does not seem to be picking this bytecode up and executing it on the webpage, so any thoughts as to why this might be the case?
I’m using Haxe 3.2.1.