rsnext/examples
Resi Respati 42bf21091e [with-typescript] Updated TypeScript example to use API routes (#9073)
* [with-typescript] Updated TypeScript example to use API routes

Next.js 9.0.0 has been out for a while, which supports API routes, but
the examples were never updated to make use of it. This PR adds a simple
example of an API route which also makes use of dynamic routing.

A simple `fetch()` wrapper is also added for example purposes, and the
pages structure have also been updated to dynamic routing.

* Properly link to the dynamic page
2019-10-16 13:38:14 -05:00
..
active-class-name Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
amp Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
amp-story Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
analyze-bundles Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
api-routes Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
api-routes-apollo-server-and-client Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
api-routes-graphql Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
api-routes-micro Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
api-routes-middleware Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
api-routes-rest Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
auth0 Update README.md (#9040) 2019-10-11 14:14:17 +02:00
basic-css Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
basic-export Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
blog-starter Updated multiple examples to use /public (#9033) 2019-10-11 11:50:06 +02:00
custom-charset Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
custom-server Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
custom-server-actionhero Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
custom-server-express Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
custom-server-fastify Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
custom-server-hapi Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
custom-server-koa Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
custom-server-micro Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
custom-server-nodemon Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
custom-server-polka Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
custom-server-reasonml Update remaining examples to latest Next.js 2019-07-08 19:37:58 -04:00
custom-server-typescript Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
data-fetch Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
dynamic-routing Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
form-handler Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
gh-pages Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
head-elements Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
hello-world Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
layout-component Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
nested-components Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
only-client-render-external-dependencies Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
page-transitions Remove page-transitions example 2018-05-25 14:19:40 +02:00
parameterized-routing Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
progressive-render Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
shared-modules Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
ssr-caching Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
svg-components Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
using-inferno [using-inferno] Update inferno to v7.3, fix missing React.createContext function (#9038) 2019-10-16 12:38:19 -05:00
using-nerv Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
using-preact [using-preact] Update example to Preact X (#9079) 2019-10-16 01:39:33 -04:00
using-router Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
using-with-router Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-absolute-imports Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-algolia-react-instantsearch Updated multiple examples to use /public (#9033) 2019-10-11 11:50:06 +02:00
with-ant-design Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-ant-design-less Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-antd-mobile Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-aphrodite Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-apollo Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-apollo-and-redux Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-apollo-and-redux-saga Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-apollo-auth Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-app-layout Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-asset-imports Updated multiple examples to use /public (#9033) 2019-10-11 11:50:06 +02:00
with-astroturf Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-aws-amplify Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-aws-amplify-typescript Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-babel-macros Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-carbon-components Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-carlo Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-cerebral Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-cloud9 Update remaining examples to latest Next.js 2019-07-08 19:37:58 -04:00
with-componentdidcatch Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-configured-preset-env Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-context-api Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-cookie-auth Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-custom-babel-config Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-custom-reverse-proxy Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-cxs Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-data-prefetch Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-docker Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-dotenv Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-draft-js Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-dynamic-app-layout Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-dynamic-import Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-electron Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-electron-typescript Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-emotion Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-emotion-fiber Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-env-from-next-config-js Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-external-scoped-css Remove deploy to now button from all examples (#7101) 2019-05-27 12:22:05 -07:00
with-external-styled-jsx-sass Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-fela Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-firebase-authentication Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-firebase-cloud-messaging Remove deploy to now button from all examples (#7101) 2019-05-27 12:22:05 -07:00
with-firebase-hosting Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-firebase-hosting-and-docker Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-firebase-hosting-and-typescript Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-flow Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-freactal Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-glamor Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-glamorous Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-global-stylesheet Remove with-global-stylesheet example (#4913) 2018-08-07 18:36:28 -07:00
with-global-stylesheet-simple Remove with-global-stylesheet example (#4913) 2018-08-07 18:36:28 -07:00
with-google-analytics Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-graphql-hooks Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-graphql-react Deprecate Container usage (#8327) 2019-08-11 22:02:33 +02:00
with-grommet Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-hashed-statics Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-higher-order-component Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-http2 Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-immutable-redux-wrapper Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-ioc Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-jest Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-jest-flow Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-jest-react-testing-library Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-jest-typescript Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-kea Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-linaria Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-lingui Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-loading Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-markdown Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-material-ui docs: removes npx info & moves src link up (#4972) 2018-08-19 22:26:50 +02:00
with-mdx Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-mobx Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-mobx-react-lite Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-mobx-state-tree Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-mobx-state-tree-typescript Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-mocha Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-next-css Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-next-i18next Update README.md 2019-03-07 13:20:46 +01:00
with-next-less Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-next-offline Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-next-page-transitions Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-next-routes Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-next-sass Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-next-seo Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-noscript Simplify with-noscript example (#9094) 2019-10-16 12:36:40 +02:00
with-now-env Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-office-ui-fabric-react Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-orbit-components Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-overmind Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-pkg Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-polyfills Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-portals Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-portals-ssr Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-prefetching Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-pretty-url-routing Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-quill-js Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-rbx-bulma-pro Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-react-css-modules Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-react-esi Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-react-ga Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-react-helmet Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-react-intl Fix language fallback in with-react-intl example (#8894) 2019-10-16 01:52:49 -04:00
with-react-jss Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-react-md Updated multiple examples to use /public (#9033) 2019-10-11 11:50:06 +02:00
with-react-multi-carousel Deprecate Container usage (#8327) 2019-08-11 22:02:33 +02:00
with-react-native-web Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-react-relay-network-modern Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-react-toolbox Update with-react-toolbox example to use /public (#9099) 2019-10-16 14:58:04 +02:00
with-react-useragent Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-react-uwp Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-react-with-styles Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-reasonml Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-reasonml-todo Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-rebass Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-recompose Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-redux Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-redux-code-splitting Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-redux-observable Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-redux-persist Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-redux-reselect-recompose Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-redux-saga Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-redux-thunk Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-redux-wrapper Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-reflux Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-refnux Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-relay-modern Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-relay-modern-server-express Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-rematch Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-scoped-stylesheets-and-postcss Deprecate css examples 2018-01-31 11:19:34 +01:00
with-segment-analytics Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-semantic-ui Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-sentry Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-sentry-simple Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-shallow-routing Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-sitemap-and-robots-express-server Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-slate Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-socket.io Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-static-export Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-stomp Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-storybook Update storybook example to v5.2 with CSF (#9036) 2019-10-11 11:57:33 +02:00
with-strict-csp Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-strict-csp-hash Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-style-sheet Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-styled-components Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-styled-jsx-plugins Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-styled-jsx-postcss Make styled-jsx configurable (#3050) 2017-10-15 19:54:57 +02:00
with-styled-jsx-scss Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-styletron Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-sw-precache Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-tailwindcss Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-ts-node Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-typescript [with-typescript] Updated TypeScript example to use API routes (#9073) 2019-10-16 13:38:14 -05:00
with-typescript-styled-components Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-typestyle Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-typings-for-css-modules Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-universal-configuration-build-time Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-universal-configuration-runtime Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-unstated Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-url-object-routing Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-videojs Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-webassembly Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-webpack-bundle-analyzer Add analyze bundles example (#5332) 2018-10-01 01:24:27 +02:00
with-webpack-bundle-size-analyzer Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-yarn-workspaces Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
with-zeit-fetch Fix import in @zeit/fetch example (#9074) 2019-10-14 13:11:33 -05:00
with-zones Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00