Minor changes

This commit is contained in:
Eduard Urbach 2017-06-04 01:17:00 +02:00
parent 13c87d65d8
commit dac19952db
5 changed files with 11 additions and 3 deletions

2
api.go
View File

@ -21,7 +21,7 @@ func init() {
// }) // })
app.Get("/api/anime/:id", func(ctx *aero.Context) string { app.Get("/api/anime/:id", func(ctx *aero.Context) string {
id, _ := ctx.GetInt("id") id := ctx.Get("id")
anime, err := arn.GetAnime(id) anime, err := arn.GetAnime(id)
if err != nil { if err != nil {

View File

@ -3,6 +3,7 @@ component Layout(content string)
head head
title notify.moe - Beta title notify.moe - Beta
meta(name="viewport", content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes") meta(name="viewport", content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes")
link(rel="manifest", href="/manifest.json")
body body
#container #container
#header #header

View File

@ -1,6 +1,7 @@
package main package main
import ( import (
"fmt"
"io/ioutil" "io/ioutil"
"github.com/aerogo/aero" "github.com/aerogo/aero"
@ -51,6 +52,12 @@ func main() {
return ctx.JSON(app.Config.Manifest) return ctx.JSON(app.Config.Manifest)
}) })
app.Get("/ip", func(ctx *aero.Context) string {
ip := ctx.RealIP()
fmt.Println(ip)
return ctx.Text(ip)
})
// Scripts // Scripts
scripts, _ := ioutil.ReadFile("temp/scripts.js") scripts, _ := ioutil.ReadFile("temp/scripts.js")
js := string(scripts) js := string(scripts)

View File

@ -8,7 +8,7 @@ import (
// Get ... // Get ...
func Get(ctx *aero.Context) string { func Get(ctx *aero.Context) string {
id, _ := ctx.GetInt("id") id := ctx.Get("id")
anime, err := arn.GetAnime(id) anime, err := arn.GetAnime(id)
if err != nil { if err != nil {

View File

@ -1,6 +1,6 @@
component Profile(viewUser *arn.User, user *arn.User) component Profile(viewUser *arn.User, user *arn.User)
.profile .profile
.profile-cover(style=viewUser.CoverImageStyle()) //- .profile-cover(style=viewUser.CoverImageStyle())
.image-container .image-container
ProfileImage(viewUser) ProfileImage(viewUser)