0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

学び#2 expressでの静的ファイルの提供方法

Posted at

app.use(express.static('フォルダ名"));

と記載ことによって、そのフォルダ内の静的コンテンツを提供できる。
なお、このフォルダ名が起点になるので、静的コンテンツを指定する際には、指定したフォルダ(ディレクトリ)にいる前提でコンテンツ名を指定する。

※静的コンテンツとはhtmlファイルや画像などのリクエストの内容の影響を受けないコンテンツのこと

参照元:https://expressjs.com/ja/starter/static-files.html

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?