1
私はKemalを使用してCrystalに単純な静的サイトを作成しようとしています。404 GET/index.htmlが利用可能な場合
this pageになると、私はうまくいくはずですが、サイトを読み込もうとすると404が表示されます。
私のプログラムは、このようになります(あなたは私が問題を追跡しようとしてコメントアウトすべてのコードを見ることができます)
#require "./LiedThisWeek/*"
require "kemal"
#module LiedThisWeek
# TODO Put your code here
#end
#finder = LieFinder.new
#handler = HyperTextHandler.new finder
#indexPath = "public/index.html"
#
#spawn do
# loop do
# finder.refresh
# File.write indexPath, handler.getDoc
# sleep 60.second
# end
#end
Kemal.run
これは私のディレクトリ構造は次のようになります。
.
├── LICENSE
├── LiedThisWeek
├── README.md
├── lib (removed for brevity)
├── public
│ ├── css
│ │ └── style.css
│ ├── images
│ │ ├── fireworks.jpg
│ │ └── sad.jpg
│ └── index.html
├── shard.lock
├── shard.yml
├── spec
│ ├── LiedThisWeek_spec.cr
│ └── spec_helper.cr
└── src
├── LiedThisWeek
│ ├── HyperTextHandler.cr
│ ├── Lie.cr
│ ├── LieFinder.cr
│ └── version.cr
└── LiedThisWeek.cr
32 directories, 112 files
これは問題の投稿から文字通り数秒です。ありがとうございました! – Jones