{"id":21657539,"url":"https://github.com/dfw1n/nextjs","last_synced_at":"2026-05-15T12:31:13.704Z","repository":{"id":182217477,"uuid":"527035574","full_name":"DFW1N/nextjs","owner":"DFW1N","description":null,"archived":false,"fork":false,"pushed_at":"2022-08-20T20:43:28.000Z","size":99,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-28T09:02:39.796Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DFW1N.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-08-20T20:43:26.000Z","updated_at":"2022-08-20T20:43:31.000Z","dependencies_parsed_at":"2023-07-19T06:49:17.131Z","dependency_job_id":null,"html_url":"https://github.com/DFW1N/nextjs","commit_stats":null,"previous_names":["dfw1n/nextjs"],"tags_count":0,"template":false,"template_full_name":"staticwebdev/nextjs-starter","purl":"pkg:github/DFW1N/nextjs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DFW1N%2Fnextjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DFW1N%2Fnextjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DFW1N%2Fnextjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DFW1N%2Fnextjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DFW1N","download_url":"https://codeload.github.com/DFW1N/nextjs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DFW1N%2Fnextjs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33067086,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T11:35:32.926Z","status":"ssl_error","status_checked_at":"2026-05-15T11:35:31.362Z","response_time":103,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-25T09:26:53.137Z","updated_at":"2026-05-15T12:31:13.677Z","avatar_url":"https://github.com/DFW1N.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![E2E tests](https://github.com/staticwebdev/nextjs-starter/actions/workflows/playwright.js.yml/badge.svg)](https://github.com/staticwebdev/nextjs-starter/actions/workflows/playwright.js.yml)\r\n\r\n# Next.js starter\r\n\r\n[Azure Static Web Apps](https://docs.microsoft.com/azure/static-web-apps/overview) allows you to easily build [Next.js](https://nextjs.org/) apps in minutes. Use this repo with the [Next.js tutorial](https://docs.microsoft.com/azure/static-web-apps/deploy-nextjs) to build and customize a new static site.\r\n\r\n## Running locally\r\n\r\nTo run locally, open the development server with the following command:\r\n\r\n```bash\r\nnpm run dev\r\n```\r\n\r\nNext, open [http://localhost:3000](http://localhost:3000) in your browser to see the result.\r\n\r\nFor a more rich local development experience, refer to [Set up local development for Azure Static Web Apps](https://docs.microsoft.com/azure/static-web-apps/local-development).\r\n\r\n## How it works\r\n\r\nThis starter application is configured to build a static site with dynamic routes. \r\n\r\n### Dynamic routes\r\n\r\nThe *pages/project/[slug].js* file implements code that tells Next.js what pages to generate based on associated data. In Next.js, each page powered by dynamic routes needs to implement `getStaticPaths` and `getStaticProps` to give Next.js the information it needs to build pages that match possible route values.\r\n\r\nInside `getStaticPaths`, each data object is used to create a list of paths all possible pages.\r\n\r\n```javascript\r\nexport async function getStaticPaths() {\r\n  const paths = projects.map((project) =\u003e ({\r\n    params: { path: project.slug },\r\n  }))\r\n  return { paths, fallback: false };\r\n}\r\n```\r\nThe `getStaticProps` function is run each time a page is generated. Based off the parameter values, the function matches the full data object to the page being generated. Once the data object is returned, it is used as the context for the generated page.\r\n\r\n```javascript\r\nexport async function getStaticProps({ params }) {\r\n  const project = projects.find(proj =\u003e proj.slug === params.path);\r\n  return { props: { project } };\r\n}\r\n```\r\n### Application configuration\r\n\r\nThe `next.config.js` file is set up to enforce trailing slashes on all page.\r\n\r\n```javascript\r\nmodule.exports = {\r\n    trailingSlash: true\r\n};\r\n```\r\n### Build scripts\r\n\r\nThe npm `build` script runs commands to not only build the application, but also generate all the static files to the `out` folder.\r\n\r\n```json\r\n\"scripts\": {\r\n  \"dev\": \"next dev\",\r\n  \"build\": \"next build \u0026\u0026 next export\",\r\n},\r\n```\r\n\r\n\u003e **Note:** If you use the [Azure Static Web Apps CLI](https://docs.microsoft.com/azure/static-web-apps/local-development), copy the *staticwebapp.config.json* file to the *out* folder, and start the CLI from the *out* folder.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdfw1n%2Fnextjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdfw1n%2Fnextjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdfw1n%2Fnextjs/lists"}