@rootPathFromName
interface API
{
@path("mytrack") @method(HTTPMethod.GET) void postForm(string name);
}
class MyRouter : API
{
Config config;
Database database;
this(Config config, Database database)
{
this.config = config;
this.database = database;
}
void getForm(string _error = null)
{
render!("index.dt", _error);
}
@errorDisplay!getForm
void postForm(string name)
{
if (name.length == 0)
throw new Exception("Name must not be empty");
redirect("/");
}
}
The vibed 0.8.0-beta6 is going down after access to next URL http://127.0.0.1:8080/api/mytrack?name=foo
with error:
CoreTaskFiber was terminated unexpectedly: Access Violation
Program exited with code -1
What I am doing wrong?
Can I do writeln
inside getForm
instead of render!("index.dt", _error);
?