Legeo
Legeo

Reputation: 792

GatsbyJs, page inside folder

i read that gatsby create the proper page if you save items in the pages folder.

Ex---->

src/
  pages/
    Home.tsx
    LandingPage.tsx

I can reach the page, for example at http://localhost:8000/LandingPage

but what can i do if I have the following folder structure ?

src/
  pages/
    Home/
      index.tsx
    LandingPage/
      index.tsx

Upvotes: 0

Views: 235

Answers (1)

hangindev.com
hangindev.com

Reputation: 4873

If you have the following folder structure:

src/
  pages/
    Home/
      index.tsx
    LandingPage/
      index.tsx

You will get the following paths:

http://localhost:8000/Home

http://localhost:8000/LandingPage

You don't have to set anything else Gatsby figures it out for you by default.

Upvotes: 1

Related Questions