This application is built on top of
@loopback/example-greeter-extension.
-
Add REST API
- GreetingController - providing endpoints over
GreetingService
- GreetingController - providing endpoints over
-
Add caching
- CachingService - implementing cache operations, such as set,get, delete, and sweep
- CachingInterceptor - intercepting http requests to apply caching
- CacheObserver - watching and sweeping cache in the background
Run npm start:
The service is running at http://127.0.0.1:3000/greet/world.
Open your browser to try the REST APIs. You can replace world with other
names.
The following curl command sets Accept-Language header to zh to receive
the greeting in Chinese.
curl -H 'Accept-Language: zh' http://127.0.0.1:3000/greet/Ray{
"timestamp": "2019-05-29T22:48:03.040Z",
"language": "zh",
"greeting": "Ray,你好!"
}Run npm test from the root folder.
See all contributors.
MIT
