Skip to content

Commit

Permalink
feat: add to main
Browse files Browse the repository at this point in the history
  • Loading branch information
adantoscano committed Oct 3, 2023
1 parent e2d93e3 commit 43609fc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 6 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
const OpenApiMocker = require("open-api-mocker");
const cloneGitRepository = require("./services/clone-git-repository");
import OpenApiMocker from 'open-api-mocker';
import cloneGitRepository from './services/clone-git-repository.js';
import findOasFromDir from './services/find-oas-from-dir.js';

const main = async () => {
const testRepoSSH = "git@gitlab.sngular.com:os3/manatee/sirenia.git"; // TODO: replace by user input
const testRepoHTTPS = "https://gitlab.sngular.com/os3/manatee/sirenia.git"; // TODO: replace by user input
await cloneGitRepository(testRepoSSH);

const schemas = findOasFromDir('./tests');

const openApiMocker = new OpenApiMocker({
port: 5000,
schema: `${__dirname}/../tests/schema-examples/basic.yaml`,
schema: schemas[0].filePath,
watch: true,
});

Expand Down
3 changes: 2 additions & 1 deletion src/services/find-oas-from-dir.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ export default function findOasFromDir(startPath) {
console.log('-- found: ', filePath);
return [...acc, {
filename: file,
path: startPath
path: startPath,
filePath,
}]
}
return []
Expand Down

0 comments on commit 43609fc

Please # to comment.