username prop change
Penny uses authorized tokens in the header field
Authorization: Bearer YOUR_TOKEN_HERE
Tokens should be in a , separated list at the ENV variable AUTHORIZED_ACCESS_TOKENS.
,
AUTHORIZED_ACCESS_TOKENS
export AUTHORIZED_ACCESS_TOKENS=foo,bar,coo
Use the token tester when testing.
tester
osx only, otherwise configure to your environment
Use the following command to start postgres locally.
docker run --name postgres -e POSTGRES_DB=vapor -e POSTGRES_USER=vapor -e POSTGRES_PASSWORD=password -p 5432:5432 -d postgres
func makeDatabaseConfig() -> PostgreSQLDatabaseConfig { if let url = Environment.get("DATABASE_URL") { return try! PostgreSQLDatabaseConfig(url: url) } let hostname = Environment.get("DATABASE_HOSTNAME") ?? "localhost" let username = Environment.get("DATABASE_USER") ?? "vapor" let databaseName = Environment.get("DATABASE_DB") ?? "vapor" let password = Environment.get("DATABASE_PASSWORD") ?? "password" return PostgreSQLDatabaseConfig( hostname: hostname, username: username, database: databaseName, password: password ) }
©Copyright 2023 CCF 开源发展委员会 Powered by Trustie& IntelliDE 京ICP备13000930号
Penny API
Auth
Penny uses authorized tokens in the header field
Tokens
Tokens should be in a
,
separated list at the ENV variableAUTHORIZED_ACCESS_TOKENS
.Testing
Use the token
tester
when testing.Database
Start
Use the following command to start postgres locally.
Environment Variables For Deploy