🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@ax2/api-core

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ax2/api-core

API CORE documentation

latest
npmnpm
Version
0.2.2
Version published
Maintainers
1
Created
Source

API CORE

API CORE documentation

Setup

Install the module

yarn add @ax2/api-core

Necessary Env variables

OptionDescription
NODE_ENVlocal, prod or dev
LANG_FALLBACKdefault lang to use (default ='en')
LANG_KEYSmultilang keys (example 'fr,en')
MEDIA_DIRECTORYDirectory on gcp in bucket
GCP_PROJECT_IDProject ID from gcp
STORAGE_BUCKETName of the bucket in on gcp storage
MEDIA_RESIZINGSet to 1 to use resize media
MYSQL_DB_NAMEMySQL database name
MYSQL_DB_USERMySQL user
MYSQL_DB_PASSWORDMySQL password
MYSQL_DB_HOSTMySQL host (default: 127.0.0.1)
MYSQL_DB_PORTMysql Port (default: 3306)
REDIS_HOSTRedis Host (default: 127.0.0.1)
REDIS_PORTRedis Port (default: 6379)
REDIS_PASSWORDRedis Password (default: '')
REDIS_PREFIXRedis prefix for cache key (default: '')
REDIS_ENABLESet to 1 to enable Redis (default: disabled)
SENTRYSentry DSN
API_VERSIONAPI version return in response
SITE_URLSITE url for referer to allow cms preview

Load the module into the core

import * as CORE from '@ax2/api-core';
class Article extends CORE.Citadelle {}

import { Citadelle } from '@ax2/api-core';
class Article extends Citadelle implements ModelItem {}

Available class

// Config connection
import { db, language, storage } from '@ax2/api-core';

// Controller core
import { MotherBase } from '@ax2/api-core';

// Helpers function
import { ApiResponse, redis, Sentry, Validator } from '@ax2/api-core';

// Model function
import { Citadelle } from '@ax2/api-core';

FAQs

Package last updated on 09 Jun 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts