fix: default custom-env-config settings caused name conflicts by FossPrime · Pull Request #3193 · feathersjs/feathers · GitHub
Skip to content
Open
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 packages/generators/src/app/templates/app.test.tpl.ts
2 changes: 1 addition & 1 deletion packages/generators/src/app/templates/client.test.tpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { createClient } from '../${lib}/client'
import rest from '@feathersjs/rest-client'

const port = app.get('port')
const appUrl = \`http://\${app.get('host')}:\${port}\`
const appUrl = \`http://localhost:\${port}\`

describe('client tests', () => {
const client = createClient(rest(appUrl).axios(axios))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,14 @@ const defaultConfig = ({}: AppGeneratorContext) => ({

const customEnvironment = {
port: {
__name: 'PORT',
__name: 'FEATHERS_PORT',
__format: 'number'
},
host: 'HOSTNAME',
host: 'FEATHERS_HOSTNAME',
origins: {
__name: 'FEATHERS_ORIGINS',
__format: 'json'
},
authentication: {
secret: 'FEATHERS_SECRET'
}
Expand All @@ -41,9 +45,9 @@ export const configurationSchema = {
required: [ 'host', 'port', 'public' ],
properties: {
...defaultAppSettings,
host: { type: 'string' },
port: { type: 'number' },
public: { type: 'string' }
public: { type: 'string' },
origins: { type: 'array', items: { type: 'string' } }
}
} as const

Expand All @@ -61,9 +65,9 @@ import { dataValidator } from './validators'
export const configurationSchema = Type.Intersect([
defaultAppConfiguration,
Type.Object({
host: Type.String(),
port: Type.Number(),
public: Type.String()
public: Type.String(),
origins: Type.Array(Type.String())
})
])

Expand Down
4 changes: 2 additions & 2 deletions packages/generators/src/app/templates/index.tpl.ts