Skip to content

Commit d8cc189

Browse files
committed
docs: version in docs taken from version file
1 parent 9103a82 commit d8cc189

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.2
1+
1.0.3

src/swaggerDefinition.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
1+
const fs = require('fs');
12
const swaggerJsdoc = require('swagger-jsdoc');
23

4+
// Read version from the VERSION file in the parent directory
5+
const version = fs.readFileSync('../VERSION', 'utf8').trim();
6+
37
const options = {
48
swaggerDefinition: {
5-
openapi: '3.0.0',
9+
openapi: '3.0.0',
610
info: {
711
title: 'GitHub Metadata API',
8-
version: '0.0.1',
12+
version: version, // Use the version read from the file
913
},
1014
},
1115
apis: ['./src/metadataExtractor/routes.js', './src/metadataUpdater/routes.js'],
1216
};
1317

1418
const swaggerSpecification = swaggerJsdoc(options);
1519

16-
module.exports = swaggerSpecification;
17-
20+
module.exports = swaggerSpecification;

0 commit comments

Comments
 (0)