Compare commits
3 Commits
1adca23620
...
13b5d6dbdd
Author | SHA1 | Date | |
---|---|---|---|
13b5d6dbdd | |||
e4531a92d7 | |||
bf0ab3e019 |
7
~/Crystal/Kemal/example.cr
Normal file
7
~/Crystal/Kemal/example.cr
Normal file
@ -0,0 +1,7 @@
|
||||
require "kemal"
|
||||
|
||||
get "/" do
|
||||
"Hello World!"
|
||||
end
|
||||
|
||||
Kemal.run
|
19
~/Crystal/Kemal/routes.cr
Normal file
19
~/Crystal/Kemal/routes.cr
Normal file
@ -0,0 +1,19 @@
|
||||
get "/" do
|
||||
..show something..
|
||||
end
|
||||
|
||||
post "/" do
|
||||
..create something..
|
||||
end
|
||||
|
||||
put "/" do
|
||||
..replace something..
|
||||
end
|
||||
|
||||
patch "/" do
|
||||
..modify something..
|
||||
end
|
||||
|
||||
delete "/" do
|
||||
..a
|
||||
end
|
3
~/Crystal/Kemal/shards.yml
Normal file
3
~/Crystal/Kemal/shards.yml
Normal file
@ -0,0 +1,3 @@
|
||||
dependencies:
|
||||
kemal:
|
||||
github: kemalcr/kemal
|
9
~/Crystal/ctrl-c_interrupt.cr
Normal file
9
~/Crystal/ctrl-c_interrupt.cr
Normal file
@ -0,0 +1,9 @@
|
||||
LibC.signal Signal::INT.value, ->(s : Int32) {
|
||||
puts "CTRL-C handler here!"
|
||||
exit
|
||||
}
|
||||
|
||||
Signal::INT.trap do
|
||||
puts "CTRL-C handler here!"
|
||||
exit
|
||||
end
|
6
~/JavaScript/timestamp_to_date.js
Normal file
6
~/JavaScript/timestamp_to_date.js
Normal file
@ -0,0 +1,6 @@
|
||||
/*
|
||||
Необходимо timestamp умножить на 1000, поскольку JavaScript отсчитывает время
|
||||
с момента epoch (который равен 01/01/1970) в миллисекундах, а не в секундах.
|
||||
*/
|
||||
|
||||
let date = new Date(timestamp * 1000);
|
Loading…
Reference in New Issue
Block a user