- middleware for express
- sqlite based tool
- crud included
- callback required
-
Install
npm install huafua
-
Configuration
//引用中间件包 var middleware=require("huafua"); var app=express(); app.use(middleware({ dbname:"./data.sqlite" //sqlite文件路径 })); app.get("/",function(req,res){ res.find("student",function(err,data){ if(err){ res.json(e); }else{ res.json(data); } }) });
-
Run and test
start the server
node app.js
and open
http://localhost:8080
hope it helps!