mirror of
https://github.com/kataras/iris.git
synced 2026-01-09 04:51:56 +00:00
create the new FileServer and HandleDir, deprecate the rest APIBuilder/Party static methods and more
relative: https://github.com/kataras/iris/issues/1283 and removing pongo2 from vendor: https://github.com/kataras/iris/issues/1284 Former-commit-id: 3ec57b349f99faca2b8e36d9f7252db0b6ea080d
This commit is contained in:
@@ -8,7 +8,7 @@ import (
|
||||
|
||||
func main() {
|
||||
app := iris.New()
|
||||
app.StaticWeb("/scripts", "./www/scripts") // serve the scripts
|
||||
app.HandleDir("/scripts", "./www/scripts") // serve the scripts
|
||||
// when you edit a typescript file from the alm-tools
|
||||
// it compiles it to javascript, have fun!
|
||||
|
||||
|
||||
12
typescript/_examples/editor/www/scripts/app.js
Normal file
12
typescript/_examples/editor/www/scripts/app.js
Normal file
@@ -0,0 +1,12 @@
|
||||
var User = (function () {
|
||||
function User(fullname) {
|
||||
this.name = fullname;
|
||||
}
|
||||
User.prototype.Hi = function (msg) {
|
||||
return msg + " " + this.name;
|
||||
};
|
||||
return User;
|
||||
}());
|
||||
var user = new User("iris web framework!");
|
||||
var hi = user.Hi("Hello");
|
||||
window.alert(hi);
|
||||
@@ -14,7 +14,7 @@ import (
|
||||
func main() {
|
||||
app := iris.New()
|
||||
|
||||
app.StaticWeb("/scripts", "./www") // serve the scripts
|
||||
app.HandleDir("/scripts", "./www") // serve the scripts
|
||||
|
||||
app.Get("/", func(ctx iris.Context) {
|
||||
ctx.ServeFile("./www/index.html", false)
|
||||
|
||||
Reference in New Issue
Block a user