I have following problem - i am using swagger-ui-express and when i am not on developement env i am facing parsing issue with my swagger;
{"message":"Parsing swagger document failed. SyntaxError: Unexpected token :"}
This is in my swagger.js:
const {developmentEnv} = config;
const swaggerFile = developmentEnv
? jsYaml.safeLoad(fs.readFileSync('./src/api/swagger.yml'))
: require('../../api/swagger.yml');
I think, problem is with require. Yaml seems to be problem here. Can anybody help me with this please?