Create-react-app: Best way to load a folder of static files?

Created on 12 Jul 2017  路  2Comments  路  Source: facebook/create-react-app

I'm using a library that requires me to load a full folder of static files. It takes in a URL like localhost:3000/static/folder/ and then it reads in all of those files in that folder (it will read localhost:3000/static/folder/index.html, etc).

What's the best way to do this with create-react-app? I can host this files somewhere else but I'd like to host them in the same app.

Most helpful comment

Oh, so today I learned this is what the public folder is for.

Just stick whatever folder you want loaded in the public folder.

All 2 comments

Oh, so today I learned this is what the public folder is for.

Just stick whatever folder you want loaded in the public folder.

Yep, that works! Glad you figured it out.

Was this page helpful?
0 / 5 - 0 ratings