From c32ec0fc6daeda88220937d97d88e1f4e4aef971 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Thu, 7 Jun 2018 13:47:08 +0900 Subject: [PATCH] Initial commit --- .gitignore | 34 ++++++++++++++++++++++++++++++++++ .travis.yml | 21 +++++++++++++++++++++ LICENSE | 2 +- README.md | 18 ++++++++++++++++++ config.json | 21 +++++++++++++++++++++ main.go | 18 ++++++++++++++++++ main_test.go | 22 ++++++++++++++++++++++ scripts/main.ts | 1 + tsconfig.json | 8 ++++++++ 9 files changed, 144 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100644 .travis.yml create mode 100644 config.json create mode 100644 main.go create mode 100644 main_test.go create mode 100644 scripts/main.ts create mode 100644 tsconfig.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3675468 --- /dev/null +++ b/.gitignore @@ -0,0 +1,34 @@ +# Aero: Folders +/components +/security +/db + +# Aero: Files +*.log + +# Aero: TypeScript +*.js + +# Folders +_obj +_test +vendor + +# Files +*.o +*.a +*.so +*.cgo1.go +*.cgo2.c +*.exe +*.test +*.prof + +# Special files +_testmain.go +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +# Project specific +/konnakanji diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..9943af9 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,21 @@ +language: go + +go: + - 1.10.x + - master + +install: true + +matrix: + allow_failures: + - go: master + fast_finish: true + +before_script: + - bash <(curl -s https://raw.githubusercontent.com/blitzprog/gotravis/master/before-script.sh) + +script: + - bash <(curl -s https://raw.githubusercontent.com/blitzprog/gotravis/master/script.sh) + +after_success: + - bash <(curl -s https://raw.githubusercontent.com/blitzprog/gotravis/master/after-success.sh) \ No newline at end of file diff --git a/LICENSE b/LICENSE index d8ff356..a8000c8 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2018 konnakanji +Copyright (c) 2018 Eduard Urbach Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index ba02022..0eadecd 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,20 @@ # konnakanji + +[![Godoc reference][godoc-image]][godoc-url] +[![Go report card][goreportcard-image]][goreportcard-url] +[![Tests][travis-image]][travis-url] +[![Code coverage][codecov-image]][codecov-url] +[![License][license-image]][license-url] + Study Kanji by testing your own vocabulary list. + +[godoc-image]: https://godoc.org/github.com/konnakanji/konnakanji?status.svg +[godoc-url]: https://godoc.org/github.com/konnakanji/konnakanji +[goreportcard-image]: https://goreportcard.com/badge/github.com/konnakanji/konnakanji +[goreportcard-url]: https://goreportcard.com/report/github.com/konnakanji/konnakanji +[travis-image]: https://travis-ci.org/konnakanji/konnakanji.svg?branch=master +[travis-url]: https://travis-ci.org/konnakanji/konnakanji +[codecov-image]: https://codecov.io/gh/konnakanji/konnakanji/branch/master/graph/badge.svg +[codecov-url]: https://codecov.io/gh/konnakanji/konnakanji +[license-image]: https://img.shields.io/badge/license-MIT-blue.svg +[license-url]: https://github.com/konnakanji/konnakanji/blob/master/LICENSE diff --git a/config.json b/config.json new file mode 100644 index 0000000..e202ac6 --- /dev/null +++ b/config.json @@ -0,0 +1,21 @@ +{ + "domain": "konnakanji.app", + "title": "Konna Kanji", + "fonts": [], + "styles": [], + "scripts": { + "main": "main" + }, + "push": [], + "manifest": { + "name": "Konna Kanji", + "short_name": "Konna Kanji", + "start_url": "/", + "display": "standalone", + "lang": "en" + }, + "ports": { + "http": 4000, + "https": 4001 + } +} \ No newline at end of file diff --git a/main.go b/main.go new file mode 100644 index 0000000..dd0f04f --- /dev/null +++ b/main.go @@ -0,0 +1,18 @@ +package main + +import ( + "github.com/aerogo/aero" +) + +func main() { + app := aero.New() + configure(app).Run() +} + +func configure(app *aero.Application) *aero.Application { + app.Get("/", func(ctx *aero.Context) string { + return ctx.Text("Konna Kanji") + }) + + return app +} diff --git a/main_test.go b/main_test.go new file mode 100644 index 0000000..223403a --- /dev/null +++ b/main_test.go @@ -0,0 +1,22 @@ +package main + +import ( + "net/http" + "net/http/httptest" + "testing" + + "github.com/aerogo/aero" + "github.com/stretchr/testify/assert" +) + +func TestApp(t *testing.T) { + app := configure(aero.New()) + + request, _ := http.NewRequest("GET", "/", nil) + request.Header.Set("Accept-Encoding", "gzip") + + response := httptest.NewRecorder() + app.Handler().ServeHTTP(response, request) + + assert.Equal(t, http.StatusOK, response.Code) +} diff --git a/scripts/main.ts b/scripts/main.ts new file mode 100644 index 0000000..b8c57fe --- /dev/null +++ b/scripts/main.ts @@ -0,0 +1 @@ +console.log("Hello World") \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..92ad144 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,8 @@ +{ + "compilerOptions": { + "target": "esnext", + "module": "commonjs", + "moduleResolution": "node", + "baseUrl": "." + } +} \ No newline at end of file