Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Redux Quick Start Guide

You're reading from   Redux Quick Start Guide A beginner's guide to managing app state with Redux

Arrow left icon
Product type Paperback
Published in Feb 2019
Publisher Packt
ISBN-13 9781789610086
Length 204 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (3):
Arrow left icon
Suresh Kumar Mukhiya Suresh Kumar Mukhiya
Author Profile Icon Suresh Kumar Mukhiya
Suresh Kumar Mukhiya
Tao Wei Tao Wei
Author Profile Icon Tao Wei
Tao Wei
James Lee James Lee
Author Profile Icon James Lee
James Lee
Arrow right icon
View More author details
Toc

Table of Contents (10) Chapters Close

Preface 1. Understanding Redux FREE CHAPTER 2. Testing 3. Routing 4. The Concept of Immutability 5. React with Redux 6. Extending Redux with Middleware 7. Debugging Redux 8. Understanding the REST API 9. Other Books You May Enjoy

Project structure


The complete code for the backend server is available in CH07/server. In this chapter, we are going to understand how the REST API can be built. Start with an empty folder and follow these steps:

  1. Initiate the project with yarn init or by creating a package.json file. We are already familiar with the process of adding and removing any npm packages from the project. Simply copy the package.json file from CH08 into your new project folder. 
  2. Create a folder called server where we can place all our backend logic. We are going to use the express framework to create backend. Inside the server folder, create a file called index.js. Inside the file, we initiate the express server with the required parameter, as follows: 
/* eslint consistent-return:0 import/order:0 */

const path = require('path');
const express = require('express');
const cookieParser = require('cookie-parser');
const methodOverride = require('method-override');
const session = require('express-session');
const bodyParser...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image