Skip to content

Commit 834ceba

Browse files
committed
chore: fixed service base
1 parent d34936f commit 834ceba

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- checkout
2121

2222
- run:
23-
name: "Install Node 16 and utils"
23+
name: "Install Node 16"
2424
command: |
2525
nvm install 16
2626

src/builder/index.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,26 @@ const createRouter = require('@arangodb/foxx/router');
88
const fs = require('fs');
99
const path = require('path');
1010

11+
const getServicesBase = () =>
12+
{
13+
const v1Path = path.join(module.context.basePath, 'foxx');
14+
if (fs.exists(v1Path))
15+
{
16+
return v1Path;
17+
}
18+
19+
const v2Path = path.join(module.context.basePath, 'src', 'foxx');
20+
if (fs.exists(v2Path))
21+
{
22+
return v2Path;
23+
}
24+
25+
console.error('Failed to setup services base');
26+
process.exit(1);
27+
};
28+
1129
const index = {
12-
foxxServicesLocation: path.join(module.context.basePath, '/foxx'),
30+
foxxServicesLocation: getServicesBase(),
1331
supportedMethods: ['all', 'get', 'post', 'put', 'delete', 'patch', 'head'],
1432

1533
assignParams(type, params, endpoint)

0 commit comments

Comments
 (0)