Created
February 12, 2016 08:35
-
-
Save postite/2059bc4600f8115a8469 to your computer and use it in GitHub Desktop.
minimalist ufront example failing with compilation server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
build.hxml | |
-main App | |
-lib erazor | |
--connect 6000 | |
--times | |
--each | |
-lib ufront-client | |
-D client | |
-js www/app.js | |
--next | |
-lib ufront-mvc | |
-D server | |
-neko www/index.n | |
#run nekotools server | |
-cmd open http://localhost:2000 | |
*/ | |
import ufront.MVC; | |
class App { | |
static var app: #if client ClientJsApplication #else UfrontApplication #end ; | |
public function new() { | |
#if server | |
app = new UfrontApplication({ | |
indexController: HomeController, | |
templatingEngines: [TemplatingEngines.erazor], | |
defaultLayout: "layout.html", | |
}); | |
#else | |
app = new ClientJsApplication({ | |
indexController: HomeController, | |
templatingEngines: [TemplatingEngines.erazor], | |
defaultLayout: "layout.html", | |
}); | |
app.listen(); | |
#end | |
app.injector.map(String,"blob").toValue("blobi"); | |
app.executeRequest(); | |
} | |
static public function main() { | |
var app = new App(); | |
} | |
} | |
class HomeController extends Controller{ | |
@inject("blob") | |
public var blob:String; | |
@post | |
@:route("/") | |
public function index(){ | |
return new ContentResult("o yeah"+blob); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment