
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
express框架是nodejs下最流行的web框架,ZExpress是在express进一步封装的一套web框架。
ZExpress其实类似express-generator,会生成一套空的项目。
直接npm全局安装即可。
npm install zexpress -g
创建项目需要一个js的配置文件。
// 项目名
name = 'SlotsAdmin';
// port
port = 3600;
// 项目标题
title = '管理后台';
// 数据库配置
dbSlots = {host: '127.0.0.1', user: 'slots', password: 'slots123', database: 'slots3'};
dbGamelog = {host: '127.0.0.1', user: 'slots', password: 'slots123', database: 'slots3'};
dbmgr = {slots3: dbSlots, gamelog: dbGamelog};
// 路由配置
routerIndex = {name: 'Index', url: '/', urlroot: '/', http: 'GET', type: 'simple', needlogin: 'true'};
routerLogin = {name: 'Login', url: '/', urlroot: '/login', http: 'GET', type: 'simple', needlogin: 'true'};
acLogin = {name: 'Login', reqparam: ['name', 'password']};
acLogout = {name: 'Logout'};
routerAdminCtrl = {name: 'AdminCtrl', url: '/', urlroot: '/adminctrl', type: 'ctrl', lstctrl: [
acLogin,
acLogout
]};
mcAddChild = {name: 'AddChild', reqparam: ['name', 'password', 'adminkey', 'gems']};
mcChgPassword = {name: 'ChgPassword', reqparam: ['pid', 'password']};
mcCleanChild = {name: 'CleanChild', reqparam: ['pid']};
mcCleanPlayer = {name: 'CleanPlayer', reqparam: ['pid', 'childid']};
mcCleanRoom = {name: 'CleanRoom', reqparam: ['roomid']};
mcProcExchg = {name: 'ProcExchg', reqparam: ['exchgid', 'proc']};
mcResetRoom = {name: 'ResetRoom', reqparam: ['roomid']};
mcUpdChild = {name: 'UpdChild', reqparam: ['pid', 'password', 'adminkey', 'gems']};
mcUpdNotice = {name: 'UpdNotice', reqparam: ['notice']};
mcUpdRoom = {name: 'UpdRoom', reqparam: ['roomid', 'minper', 'maxper', 'playerminper', 'playermaxper']};
mcUpdRoomEx = {name: 'UpdRoomEx', reqparam: ['roomid', 'curdiff']};
routerMainCtrl = {name: 'MainCtrl', url: '/', urlroot: '/mainctrl', type: 'ctrl', lstctrl: [
mcAddChild,
mcChgPassword,
mcCleanChild,
mcCleanPlayer,
mcCleanRoom,
mcProcExchg,
mcResetRoom,
mcUpdChild,
mcUpdNotice,
mcUpdRoom,
mcUpdRoomEx
]};
modEdtChild = {name: 'EdtChild'};
modEdtRoom = {name: 'EdtRoom'};
modEdtRoomEx = {name: 'EdtRoomEx'};
modLeftMenu = {name: 'LeftMenu'};
modSysNotice = {name: 'SysNotice'};
modTotal = {name: 'Total'};
modViewChild = {name: 'ViewChild'};
modViewExchg = {name: 'ViewExchg'};
modViewPlayer = {name: 'ViewPlayer'};
modViewRoom = {name: 'ViewRoom'};
routerMain = {name: 'Main', url: ['/', '/:leftmenu/'], urlroot: '/main', type: 'module', needlogin: 'true', lstmodule: [
modEdtChild,
modEdtRoom,
modEdtRoomEx,
modLeftMenu,
modSysNotice,
modTotal,
modViewChild,
modViewExchg,
modViewPlayer,
modViewRoom
]};
router = [routerIndex, routerAdminCtrl, routerMainCtrl, routerLogin, routerMain];
// 导出
projparam = {
projname: name,
port: port,
title: title,
dbmgr: dbmgr,
router: router
};
这个配置文件里,配置了数据库、路由(基本页面、ajax请求、模块混合几种),最后,我们通过下面的指令生成项目
zrestify sample.js
cd slotsadmin
npm install
就会在当前目录下生成一个名为 slotsadmin 的项目,并自动下载依赖库。
如果我们要启动服务,可以使用下面的指令:
node bin/slotsadmin.js
FAQs
zexpress
We found that zexpress demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.