User service with caching, GET and POST

In order to implement a user profile, we must first implement a UserService that can perform CRUD operations on IUser. Before creating the service, you need to be running the lemon-mart-swagger-server, so you can pull fake data with it while developing:

  1. Add a new script called mock:standalone to package.json
package.json"mock:standalone": "docker run -p 3000:3000 -t duluca/lemon-mart-swagger-server",

Note that this script presumes that you have independently built your swagger server on your local machine and/or published from a repository you can pull from.

  1. Execute the script
  2. Create a baseUrl property in environment.ts and environment.prod.ts with the url to your mock server
src/environments/environment.ts ...

Get Angular 6 for Enterprise-Ready Web Applications 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.