Remove useless env variables

This commit is contained in:
2021-06-16 14:30:19 +02:00
parent 7f4ce8cde7
commit bfa03a5667
9 changed files with 7 additions and 23 deletions

View File

@@ -1,23 +1,15 @@
PORT=
HOST=
NODE_ENV=
APP_KEY=
APP_NAME=
APP_VERSION=
APP_URL=
REDIS_CONNECTION=
REDIS_HOST=
REDIS_PORT=
REDIS_PASSWORD=
DB_CONNECTION=
MYSQL_HOST=
MYSQL_PORT=
MYSQL_USER=
MYSQL_PASSWORD=
MYSQL_DB_NAME=
SESSION_DRIVER=

View File

@@ -19,7 +19,7 @@ const databaseConfig: DatabaseConfig = {
| file.
|
*/
connection: Env.get('DB_CONNECTION'),
connection: 'mysql',
connections: {
/*

View File

@@ -5,7 +5,6 @@
* file.
*/
import Env from '@ioc:Adonis/Core/Env'
import { HashConfig } from '@ioc:Adonis/Core/Hash'
/*
@@ -27,7 +26,7 @@ const hashConfig: HashConfig = {
| free to change the default value
|
*/
default: Env.get('HASH_DRIVER', 'argon'),
default: 'argon',
list: {
/*

View File

@@ -22,7 +22,7 @@ import { RedisConfig } from '@ioc:Adonis/Addons/Redis'
| Make sure to check `contracts/redis.ts` file for defining extra connections
*/
const redisConfig: RedisConfig = {
connection: Env.get('REDIS_CONNECTION'),
connection: 'local',
connections: {
/*

View File

@@ -5,7 +5,6 @@
* file.
*/
import Env from '@ioc:Adonis/Core/Env'
import Application from '@ioc:Adonis/Core/Application'
import { SessionConfig } from '@ioc:Adonis/Addons/Session'
@@ -36,7 +35,7 @@ const sessionConfig: SessionConfig = {
| Note: Switching drivers will make existing sessions invalid.
|
*/
driver: Env.get('SESSION_DRIVER'),
driver: 'redis',
/*
|--------------------------------------------------------------------------

View File

@@ -6,7 +6,6 @@
*/
declare module '@ioc:Adonis/Core/Hash' {
import { HashDrivers } from '@ioc:Adonis/Core/Hash'
interface HashersList {
bcrypt: {

6
env.ts
View File

@@ -18,12 +18,8 @@ export default Env.rules({
HOST: Env.schema.string({ format: 'host' }),
PORT: Env.schema.number(),
APP_KEY: Env.schema.string(),
APP_NAME: Env.schema.string(),
APP_VERSION: Env.schema.string(),
APP_URL: Env.schema.string(),
NODE_ENV: Env.schema.enum(['development', 'production', 'testing'] as const),
REDIS_CONNECTION: Env.schema.enum(['local'] as const),
REDIS_HOST: Env.schema.string(),
REDIS_PORT: Env.schema.number(),
REDIS_PASSWORD: Env.schema.string.optional(),
@@ -33,6 +29,4 @@ export default Env.rules({
MYSQL_USER: Env.schema.string(),
MYSQL_PASSWORD: Env.schema.string.optional(),
MYSQL_DB_NAME: Env.schema.string(),
SESSION_DRIVER: Env.schema.string()
})

View File

@@ -1,6 +1,6 @@
{
"name": "@linkyjs/core",
"version": "1.0.0",
"version": "1.0.1",
"description": "URL Shortener for Developers 💻",
"main": "start/kernel.ts",
"repository": {

View File

@@ -4,11 +4,12 @@ import {HttpContextContract} from "@ioc:Adonis/Core/HttpContext";
import Env from "@ioc:Adonis/Core/Env";
const BASE_URL = Env.get('APP_URL')
const VERSION = require('../package.json')
Route.get('/', async ({response}: HttpContextContract) => {
return response.status(200).send({
domain: BASE_URL,
version: Env.get('APP_VERSION'),
version: VERSION,
source: `${BASE_URL}/source`,
healthCheck: `${BASE_URL}/health`,
links: `${BASE_URL}/links`