1.1.5 • Published 3 years ago
amenov-framework v1.1.5
The Amenov Framework
Setup
npm i -g amenov-framework
amenov-framework init my-project
cd my-project
Copy ".env.example" -> ".env" and add your private key to JWT_SECRET_KEY etc.
Note: Don't forget to set up your database for the next step!
npm install && npm install -g nodemon
npx sequelize db:migrate
npx sequelize db:seed:all
npm run dev
or npm run start
Directory Structure
- controllers
- database:
- migrations
- models
- seeders
- docs
- helpers
- middleware
- routes
- storage
Config.js
module.exports = {
global: {
test: 123
},
server: {
multiProcessing: false, // default
port: process.env.PORT ?? 5000 // default
},
// Add your module aliases so they are always at hand
moduleAlias: {
'@some-folder': __dirname + '/directory/some-folder'
},
middleware: {
rateLimit: {
windowMs: 5 * 60 * 1000, // default
max: 1000 // default
},
cors: {}, // default
validator: {
locale: 'en' // default: en || ru
},
router: {
baseUrl: '/', // default
routesPath: '/routes', // default
apiDocs: {
title: 'API-docs' // default
}
},
// Add your global middleware
extend: () => [require('@middleware/global/some'), ...]
},
master(config) {
console.log('I am working in the wizard when multiprocessing is running')
},
start({ config, express, app, server }) {
// Will be executed when the application starts
// Calling a global variable
console.log('Hello!', $test) // Hello 123
}
}
1.1.5
3 years ago
1.1.4
3 years ago
1.1.3
3 years ago
1.1.1
3 years ago
1.1.0
3 years ago
1.0.9
3 years ago
1.0.8
3 years ago
1.1.2
3 years ago
1.0.11
3 years ago
1.0.10
3 years ago
1.0.12
3 years ago
1.0.7
3 years ago
1.0.6
3 years ago
1.0.5
3 years ago
1.0.4
3 years ago
1.0.3
3 years ago
1.0.2
3 years ago
1.0.1
3 years ago
1.0.0
3 years ago