Skip to content

Commit a98b6ef

Browse files
authored
Create index.js
1 parent cbd6885 commit a98b6ef

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

foxx-service/index.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* Foxx Services Template
3+
* @author Skitsanos, https://linkedin.com/in/skitsanos
4+
*/
5+
const {query} = require('@arangodb');
6+
7+
module.context.use('/', require('./services/hooks-svn/index'));
8+
9+
module.context.checkAuth = headers =>
10+
{
11+
return true;
12+
};
13+
14+
module.context.use((req, res, next) =>
15+
{
16+
if (!module.context.checkAuth(req.headers))
17+
{
18+
res.throw('unauthorized');
19+
}
20+
21+
next();
22+
});

0 commit comments

Comments
 (0)