Skip to content

Commit 541ee08

Browse files
authored
feat: create a template for adding plugins (#28)
1 parent 0af9f1d commit 541ee08

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "js-personal-api",
3-
"version": "0.2.0",
3+
"version": "0.2.1",
44
"description": "API for managing personal data across various networks and providers.",
55
"homepage": "https://github.com/personal-api/core#readme",
66
"author": {

src/plugins/index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* Import your plugins here.
3+
*/
4+
5+
export default (/* app */) => {
6+
/**
7+
* Instantiate your plugins here by calling apply(app) on them.
8+
*/
9+
};

src/server.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import express from 'express';
33
import constants from './constants';
44

55
import applyMiddlewares from './middlewares';
6+
import applyPlugins from './plugins';
67
import applyRoutes from './routes';
78

89
const {
@@ -14,6 +15,7 @@ const bootstrap = async () => {
1415
const app = express();
1516

1617
applyMiddlewares(app);
18+
applyPlugins(app);
1719
applyRoutes(app);
1820

1921
app.listen(PORT, () => console.log(SERVER_STARTED.replace('$PORT', PORT)));

0 commit comments

Comments
 (0)