Skip to content
This repository was archived by the owner on Mar 12, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ workflows:
branches:
only:
- develop
- feature/enrich
- tc-skills

# Production builds are exectuted only on tagged commits to the
# master branch.
Expand Down
26 changes: 26 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
module.exports = {
env: {
browser: true,
commonjs: true,
es2021: true
},
extends: 'standard',
overrides: [
{
env: {
node: true
},
files: [
'.eslintrc.{js,cjs}'
],
parserOptions: {
sourceType: 'script'
}
}
],
parserOptions: {
ecmaVersion: 'latest'
},
rules: {
}
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.env
/node_modules
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18.17.0
11 changes: 4 additions & 7 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ const cross = require('cors')
const bodyParser = require('body-parser')
const _ = require('lodash')
const http = require('http')
const swaggerUi = require('swagger-ui-express')
const jsyaml = require('js-yaml')
const fs = require('fs')
const path = require('path')
const logger = require('./src/common/logger')
const errorMiddleware = require('./src/common/error.middleware')
const routes = require('./src/route')
Expand Down Expand Up @@ -63,10 +59,11 @@ _.each(routes, (verbs, url) => {
})
})
app.use('/', apiRouter)
const spec = fs.readFileSync(path.join(__dirname, 'docs/swagger.yaml'), 'utf8')
const swaggerDoc = jsyaml.safeLoad(spec)
// disable swagger docs as we do not want use them served by this service
// const spec = fs.readFileSync(path.join(__dirname, 'docs/swagger.yaml'), 'utf8')
// const swaggerDoc = jsyaml.safeLoad(spec)

app.use('/docs', swaggerUi.serve, swaggerUi.setup(swaggerDoc))
// app.use('/docs', swaggerUi.serve, swaggerUi.setup(swaggerDoc))

app.use(errorMiddleware())
app.use('*', (req, res) => {
Expand Down
5 changes: 3 additions & 2 deletions config/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ module.exports = {
PORT: process.env.PORT || 3001,

AUTH_SECRET: process.env.AUTH_SECRET || 'CLIENT_SECRET',
VALID_ISSUERS: process.env.VALID_ISSUERS ? process.env.VALID_ISSUERS.replace(/\\"/g, '')
VALID_ISSUERS: process.env.VALID_ISSUERS
? process.env.VALID_ISSUERS.replace(/\\"/g, '')
: '["https://topcoder-dev.auth0.com/", "https://api.topcoder.com"]',

PAGE_SIZE: process.env.PAGE_SIZE || 20,
Expand Down Expand Up @@ -38,7 +39,7 @@ module.exports = {
ES: {
HOST: process.env.ES_HOST || 'http://localhost:9200',
ES_REFRESH: process.env.ES_REFRESH || 'true',
ES_API_VERSION: process.env.ES_API_VERSION || "7.4",
ES_API_VERSION: process.env.ES_API_VERSION || '7.4',

ELASTICCLOUD: {
id: process.env.ELASTICCLOUD_ID,
Expand Down
Loading