This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
/** @type {import('@adonisjs/framework/src/Env')} */ | |
const Env = use('Env'); | |
const Url = use('url-parse'); | |
const CLEARDB_DATABASE_URL = new Url(Env.get('CLEARDB_DATABASE_URL')); | |
module.exports = { | |
connection: Env.get('DB_CONNECTION'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
source ./constants.sh | |
# PARAMS | |
env_param=$1 | |
command_param=$2 | |
function is_first_param_valid { | |
if [[ "$env_param" == ${PROD} ]] || | |
[[ "$env_param" == ${DEV} ]] || |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# background color using ANSI escape | |
bgBlack=$(tput setab 0) # black | |
bgRed=$(tput setab 1) # red | |
bgGreen=$(tput setab 2) # green | |
bgYellow=$(tput setab 3) # yellow | |
bgBlue=$(tput setab 4) # blue | |
bgMagenta=$(tput setab 5) # magenta | |
bgCyan=$(tput setab 6) # cyan |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
/** @type {import('@adonisjs/framework/src/Env')} */ | |
const Env = use('Env'); | |
module.exports = { | |
authenticator: 'jwt', | |
jwt: { | |
serializer: 'lucid', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Schema = use('Schema'); | |
class UserSchema extends Schema { | |
up () { | |
this.create('users', (table) => { | |
table.increments(); | |
table.string('username', 80) | |
.notNullable() | |
.unique(); | |
table.string('email', 254) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Model = use('Model'); | |
class Profile extends Model { | |
} | |
module.exports = Profile; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Schema = use('Schema'); | |
class ProfileSchema extends Schema { | |
up () { | |
this.create('profiles', (table) => { | |
table.increments(); | |
table.integer('user_id') | |
.unsigned() | |
.references('id') | |
.inTable('users') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Schema = use('Schema'); | |
class ProfileSchema extends Schema { | |
up () { | |
this.create('profiles', (table) => { | |
table.increments(); | |
table.integer('user_id') | |
.unsigned() | |
.references('id') | |
.inTable('users') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Route = use('Route'); | |
const { ROUTES, CONTROLLERS } = require('../../constants/routes'); | |
Route | |
.group(() => { | |
Route | |
.resource(ROUTES.ADDRESSES, CONTROLLERS.ADDRESSES) | |
.middleware('auth') | |
.apiOnly(); | |
Route |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Route = use('Route'); | |
const { ROUTES, CONTROLLERS } = require('../../constants'); | |
Route | |
.group(() => { | |
Route | |
.resource(ROUTES.ADDRESSES, CONTROLLERS.ADDRESSES) | |
.middleware('auth') | |
.apiOnly(); | |
Route |