|
13 | 13 |
|
14 | 14 | - This business logic has two ports. |
15 | 15 | - One is responsible for greeting (primary port). It should define a `greet` method with a name string parameter and should return nothing. |
16 | | -- Another is responsible for storing the message (secondary port). It should define a `store` method with a greeting string parameter and should return nothing. |
| 16 | +- Another is responsible for storing the message (secondary port). It should define a `save` method with a greeting string parameter and should return a void. |
17 | 17 |
|
18 | 18 | ## Task 2: Add the ports to the business logic |
19 | 19 |
|
|
35 | 35 |
|
36 | 36 | ## Task 5: Wire up the things |
37 | 37 |
|
38 | | -- Use the `args.ts` to wire up everything. |
| 38 | +- Use the `src/args.ts` to wire up everything. |
39 | 39 | - This file should initiate the service, the business logic with the proper secondary adapters. |
40 | 40 | - It also pass the service to the primary adapter to use it. |
41 | | -- Run your code with the `npm run ts -- args.ts Alice` command. |
| 41 | +- Run your code with the `npm run ts -- src/args.ts Alice` command. |
| 42 | + |
| 43 | +## Task 6: Create test for the service |
| 44 | + |
| 45 | +- Create some tests for the service. |
| 46 | + |
| 47 | +## Task 6: Add a new prompt application to the program |
| 48 | + |
| 49 | +- Create a new application in `src/prompt.ts`. |
| 50 | +- This application should use the same service, but right now the user enter their name |
| 51 | +in a simple prompt (`prompt-sync`). |
| 52 | +- This application really saves the greetings into the `greetings.txt` file. Each greeting is a new line. |
| 53 | + |
| 54 | +## Task 7: Add a new server application to the program. |
| 55 | + |
| 56 | +- Create a new application in `src/server.ts`. |
| 57 | +- This application should accept a `POST /greet` request. The request body is a JSON document with a name key. |
| 58 | +- The response should be a JSON document too, with a greeting key, its value is the greeting. |
| 59 | +- The greetings should be logged also the greetings JSON. It is a JSON array, every element of the array is a greeting. |
0 commit comments