Basic scripts implementation
This commit is contained in:
parent
12c8e7642d
commit
768b82b1ec
5
.gitignore
vendored
5
.gitignore
vendored
@ -44,4 +44,7 @@ debug
|
||||
/db
|
||||
|
||||
# Log files
|
||||
*.log
|
||||
*.log
|
||||
|
||||
# JS files
|
||||
*.js
|
@ -7,6 +7,7 @@ import (
|
||||
|
||||
"github.com/aerogo/aero"
|
||||
"github.com/animenotifier/arn"
|
||||
"github.com/animenotifier/notify.moe/components"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@ -17,7 +18,8 @@ func init() {
|
||||
|
||||
// Scripts
|
||||
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
|
||||
|
@ -25,9 +25,9 @@
|
||||
"fade",
|
||||
"mobile"
|
||||
],
|
||||
"static": [
|
||||
"images"
|
||||
],
|
||||
"scripts": {
|
||||
"main": "main"
|
||||
},
|
||||
"manifest": {
|
||||
"short_name": "notify.moe",
|
||||
"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",
|
||||
"baseUrl": "./"
|
||||
},
|
||||
"compileOnSave": true,
|
||||
"compileOnSave": false,
|
||||
"buildOnSave": false
|
||||
}
|
Loading…
Reference in New Issue
Block a user