Let's test it...

You have built a RESTful API that allows users to subscribe or sign up, log in, log out, get their profile, and delete their profile. These actions can be performed by making HTTP requests to the server. We will build now a small NodeJS REPL and client API that could allow you to interact with your RESTful API server with plain JavaScript functions:

  1. Move to the root of your project directory and create a new file named client-repl.js.
  2. Include the node-fetch NPM module that will allow making HTTP request to the server. Include as well, the repl and vm Node.js modules that will allow you to create an interactive Node.js REPL:
 const repl = require('repl') const util = require('util') const vm = require('vm') const fetch = ...

Get MERN Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.