SystemBlocks ·
blocks bases easy rest api building framework.
Installing ?
npm i -S systemblocks
Starting express server ?
file: /index.js
; Blocks;
Config file
file: /config/index.js
db: "mongodb://localhost:27017/systemblocks" TIMEOUT: HOOK_PROMISE: 20 * 1000
New database modal ?
file: /applications/auth/modals/user.js
;; const Schema = mongoose; Modal { const structure = name: type: String required: true username: type: String required: true password: type: String required: true ; super structure application: "auth" name: "User" ; }
* Note that collection name in database will be 'auth_users'
New Route ?
file: /applications/auth/routes/login.js
;;; Controller { super application: "auth" ; } @ async { const name username password = reqbody; const saved = await name username password ; res; } @ async { const users = await _blockmodalsauthUser; res; }
Test Now
Create User
PUT /auth/login