Our great sponsors
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
You can also clone the GitHub repo git clone https://github.com/RestDB/codehooks-io-examples.git
Then open the src/App.js file in your favorite code editor (some prefer VS Code and others like Vim 🥔 🍅) and replace the default generated code with the React code example shown below. If you read the code comments you'll get a pretty good idea of what's going on.
How do you set up an easy backend for React? In this example we'll create a simple React app front-end with a Node.js codehooks.io backend API and database. The main objective of this example is to learn how to use codehooks.io as an API backend for your React app.
We'll be using the standard create-react-app to kick-start our React example app development.
Then open the src/App.js file in your favorite code editor (some prefer VS Code and others like Vim 🥔 🍅) and replace the default generated code with the React code example shown below. If you read the code comments you'll get a pretty good idea of what's going on.
For a more comprehensive React example app, check out this this blog post on how to create a serveless quote api. The blog post shows how you can create a React example backend with a large dataset and fast data lookups. For real use cases, you probably don't want to use API keys, but use a service like Auth0 and JWT tokens. Check out our blog post about how to authenticate a React app against a serverless backend API for details.