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:
- Move to the root of your project directory and create a new file named client-repl.js.
- 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 = ...