forked from ensdomains/ens-metadata-service
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docgen.js
27 lines (23 loc) · 816 Bytes
/
docgen.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
const swaggerAutogen = require('swagger-autogen')({ openapi: '3.0.0' });
const PORT = process.env.PORT || 8080;
const HOST = process.env.HOST || 'localhost';
const ENV = process.env.ENV || 'local'; // local/prod
const SERVER_URL =
ENV === 'local' ? `http://localhost:${PORT}` : `https://${HOST}`;
const outputFile = './src/assets/doc_output.json';
const endpointsFiles = ['./src/endpoint.ts', './src/metadata.ts'];
const doc = {
info: {
version: '0.0.1-alpha.0',
title: 'ENS Metadata Service',
description: 'Set of endpoints to query ENS metadata and more',
contact: "[email protected]",
license: "MIT License",
x_logo: {
"url": "./src/assets/logo.svg",
"backgroundColor": "#FFFFFF"
}
},
host: SERVER_URL,
};
swaggerAutogen(outputFile, endpointsFiles, doc);