Movatterモバイル変換


[0]ホーム

URL:


Migrate to Netlify Today

Netlify announces the next evolution of Gatsby Cloud.Learn more

SupportLog In

Function routing shares the same syntax aspage routing.

Static Routing

Both top-level and nested routes are supported.

  • src/api/top-level.js =>/api/top-level
  • src/api/directory/foo.js =>/api/directory/foo

index.js files are routed at their directory path e.g.src/api/users/index.js =>/api/users

Dynamic Routing

Param routes

Use square brackets ([ ]) in the file path to mark dynamic segments of the URL.

So to create an Function for fetching user information byuserId:

Dynamic routes share syntax withclient-only routes.

Splat routes

Gatsby also supports splat (or wildcard) routes, which are routes that will match anything after the splat. These are less common, but still have use cases.

Start building today on Netlify!

Gatsby is powered by the amazing Gatsby
community and Gatsby, the company.


[8]ページ先頭

©2009-2025 Movatter.jp