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:
- 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.
- Execute the script
- Create a baseUrl property in environment.ts and environment.prod.ts with the url to your mock server
src/environments/environment.ts
export const environment = {
production: false,
baseUrl: 'http://localhost:3000'
}
- Create a UserService...