Basic scripts implementation
This commit is contained in:
parent
12c8e7642d
commit
768b82b1ec
3
.gitignore
vendored
3
.gitignore
vendored
@ -45,3 +45,6 @@ debug
|
|||||||
|
|
||||||
# Log files
|
# Log files
|
||||||
*.log
|
*.log
|
||||||
|
|
||||||
|
# JS files
|
||||||
|
*.js
|
@ -7,6 +7,7 @@ import (
|
|||||||
|
|
||||||
"github.com/aerogo/aero"
|
"github.com/aerogo/aero"
|
||||||
"github.com/animenotifier/arn"
|
"github.com/animenotifier/arn"
|
||||||
|
"github.com/animenotifier/notify.moe/components"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@ -17,7 +18,8 @@ func init() {
|
|||||||
|
|
||||||
// Scripts
|
// Scripts
|
||||||
app.Get("/scripts.js", func(ctx *aero.Context) string {
|
app.Get("/scripts.js", func(ctx *aero.Context) string {
|
||||||
return ctx.File("temp/scripts.js")
|
ctx.SetResponseHeader("Content-Type", "application/javascript")
|
||||||
|
return components.JS()
|
||||||
})
|
})
|
||||||
|
|
||||||
// Favicon
|
// Favicon
|
||||||
|
@ -25,9 +25,9 @@
|
|||||||
"fade",
|
"fade",
|
||||||
"mobile"
|
"mobile"
|
||||||
],
|
],
|
||||||
"static": [
|
"scripts": {
|
||||||
"images"
|
"main": "main"
|
||||||
],
|
},
|
||||||
"manifest": {
|
"manifest": {
|
||||||
"short_name": "notify.moe",
|
"short_name": "notify.moe",
|
||||||
"gcm_sender_id": "941298467524",
|
"gcm_sender_id": "941298467524",
|
||||||
|
5
scripts/hello.ts
Normal file
5
scripts/hello.ts
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
export class Greeter {
|
||||||
|
greet(name: string) {
|
||||||
|
console.log("Hello, " + name)
|
||||||
|
}
|
||||||
|
}
|
@ -1 +0,0 @@
|
|||||||
console.log("Hello World")
|
|
4
scripts/main.ts
Normal file
4
scripts/main.ts
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
import {Greeter} from "scripts/hello"
|
||||||
|
|
||||||
|
var greeter = new Greeter()
|
||||||
|
greeter.greet("World")
|
File diff suppressed because one or more lines are too long
@ -5,6 +5,6 @@
|
|||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"baseUrl": "./"
|
"baseUrl": "./"
|
||||||
},
|
},
|
||||||
"compileOnSave": true,
|
"compileOnSave": false,
|
||||||
"buildOnSave": false
|
"buildOnSave": false
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user