Skip to content

Commit 713c89a

Browse files
committed
use app parameter instead of this
1 parent 338fe6a commit 713c89a

5 files changed

Lines changed: 5 additions & 15 deletions

File tree

api/services/authentication/index.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ function populateUser() {
1111
};
1212
}
1313

14-
export default function authenticationService() {
15-
const app = this;
16-
14+
export default function authenticationService(app) {
1715
const config = app.get('config').auth;
1816

1917
app

api/services/custom/index.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import _ from 'lodash';
22
import { SOCKET_KEY } from '@feathersjs/socketio';
33

4-
export default function customService() {
5-
const app = this;
6-
4+
export default function customService(app) {
75
app.use('/load-info', (req, res) => {
86
res.json({
97
message: 'This came from the api server',

api/services/index.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ import custom from './custom';
33
import users from './users';
44
import messages from './messages';
55

6-
export default function services() {
7-
const app = this;
8-
6+
export default function services(app) {
97
app.configure(authentication);
108
app.configure(custom);
119
app.configure(users);

api/services/messages/index.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ const updateVisitors = app => {
1313
});
1414
};
1515

16-
export default function messagesService() {
17-
const app = this;
18-
16+
export default function messagesService(app) {
1917
const options = {
2018
Model: new NeDB({
2119
filename: `${__dirname}/messages.nedb`,

api/services/users/index.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ import feathersNedb from 'feathers-nedb';
22
import NeDB from 'nedb';
33
import hooks from './hooks';
44

5-
export default function userService() {
6-
const app = this;
7-
5+
export default function userService(app) {
86
const options = {
97
Model: new NeDB({
108
filename: `${__dirname}/users.nedb`,

0 commit comments

Comments
 (0)