https://github.com/actionhero/ah-sample-plugin
A sample actionhero plugin
https://github.com/actionhero/ah-sample-plugin
Last synced: 8 months ago
JSON representation
A sample actionhero plugin
- Host: GitHub
- URL: https://github.com/actionhero/ah-sample-plugin
- Owner: actionhero
- Created: 2014-03-18T23:22:15.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2018-09-26T01:57:48.000Z (over 7 years ago)
- Last Synced: 2025-09-09T11:55:15.778Z (9 months ago)
- Language: JavaScript
- Size: 46.9 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ah-sample-plugin
[](https://circleci.com/gh/actionhero/ah-sample-plugin)
I am a simple sample plugin for actionhero. I don't do much, as I am just an example.
I will add timing information to each action, using a response key defined in a new config file. If `api.config['ah-sample-plugin'].timingKey = delta`, all actions would now have `response.delta`.
## Install
```bash
npm install ah-sample-plugin --save
```
Then add it to your project's `./config/plugins.js`:
```js
exports['default'] = {
plugins: (api) => {
return {
'ah-sample-plugin': { path: __dirname + '/../node_modules/ah-sample-plugin' }
}
}
}
```
Create a new config file, `./config/ah-sample-plugin.js`:
```js
exports.default = {
'ah-sample-plugin': (api) => {
return { timingKey: 'delta' }
}
}
```