Add web server
This commit is contained in:
parent
73ed1eca06
commit
72fe4e5569
@ -1,10 +1,12 @@
|
|||||||
FROM alpine:edge as builder
|
FROM alpine:3.10.3 as builder
|
||||||
|
|
||||||
# Install crystal and dev libs
|
# Install crystal and dev libs
|
||||||
RUN apk add -u \
|
RUN apk add -u \
|
||||||
|
make \
|
||||||
crystal \
|
crystal \
|
||||||
shards \
|
shards \
|
||||||
make \
|
|
||||||
tzdata \
|
tzdata \
|
||||||
libc-dev \
|
libc-dev \
|
||||||
|
zlib-dev \
|
||||||
|
libressl-dev \
|
||||||
yaml-dev
|
yaml-dev
|
||||||
|
4
Makefile
4
Makefile
@ -23,6 +23,10 @@ format:
|
|||||||
run: format
|
run: format
|
||||||
crystal run $(ENTRY_POINT)
|
crystal run $(ENTRY_POINT)
|
||||||
|
|
||||||
|
.PHONY: run-server
|
||||||
|
run-server: format
|
||||||
|
server run $(ENTRY_POINT)
|
||||||
|
|
||||||
.PHONY: spec
|
.PHONY: spec
|
||||||
spec: format
|
spec: format
|
||||||
crystal spec --warnings all --error-on-warnings --error-trace
|
crystal spec --warnings all --error-on-warnings --error-trace
|
||||||
|
16
shard.lock
16
shard.lock
@ -4,3 +4,19 @@ shards:
|
|||||||
github: crystal-ameba/ameba
|
github: crystal-ameba/ameba
|
||||||
version: 0.10.1
|
version: 0.10.1
|
||||||
|
|
||||||
|
exception_page:
|
||||||
|
github: crystal-loot/exception_page
|
||||||
|
version: 0.1.2
|
||||||
|
|
||||||
|
kemal:
|
||||||
|
github: kemalcr/kemal
|
||||||
|
version: 0.25.2
|
||||||
|
|
||||||
|
kilt:
|
||||||
|
github: jeromegn/kilt
|
||||||
|
version: 0.4.0
|
||||||
|
|
||||||
|
radix:
|
||||||
|
github: luislavena/radix
|
||||||
|
version: 0.3.9
|
||||||
|
|
||||||
|
@ -12,6 +12,11 @@ crystal: 0.31.1
|
|||||||
|
|
||||||
license: MIT
|
license: MIT
|
||||||
|
|
||||||
|
dependencies:
|
||||||
|
kemal:
|
||||||
|
github: kemalcr/kemal
|
||||||
|
version: ~> 0.25.2
|
||||||
|
|
||||||
development_dependencies:
|
development_dependencies:
|
||||||
ameba:
|
ameba:
|
||||||
github: crystal-ameba/ameba
|
github: crystal-ameba/ameba
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
require "kemal"
|
||||||
require "./dayoff/**"
|
require "./dayoff/**"
|
||||||
|
|
||||||
module Dayoff
|
module Dayoff
|
||||||
@ -9,3 +10,9 @@ module Dayoff
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
get "/" do
|
||||||
|
"Hello World!"
|
||||||
|
end
|
||||||
|
|
||||||
|
Kemal.run
|
||||||
|
16
tools/server
Executable file
16
tools/server
Executable file
@ -0,0 +1,16 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
TTY=
|
||||||
|
|
||||||
|
if [ -t 1 ] ; then
|
||||||
|
TTY=-t
|
||||||
|
fi
|
||||||
|
|
||||||
|
docker run -i $TTY \
|
||||||
|
-u "$(id -u):$(id -g)" \
|
||||||
|
-v "$PWD:/app" \
|
||||||
|
-p "3000:3000" \
|
||||||
|
-w "/app" \
|
||||||
|
dayoff-crystal crystal "$@"
|
Loading…
Reference in New Issue
Block a user