node-fun / siyuan Goto Github PK
View Code? Open in Web Editor NEWAn SNS backend framework, with Node and MySQL
License: MIT License
An SNS backend framework, with Node and MySQL
License: MIT License
By helping fix @ade951 's routes/groups.js
, I find out an issue.
Obviously, the advantage is "simple, directly"
However, I have 2 points to tell it is not so good:
then
catch
// routes/starship.js
app.post('/api/starship/unstar', function (req, res, next) {
if (!req.user) return next(errors[21301]);
Starship.forge(
_.pick(req.body, 'id')
).fetch()
.then(function (starship) {
if (!starship) return Promise.reject(errors[20603]);
if (starship.get('userid') != req.user.id) {
return Promise.reject(errors[20102]);
}
return starship.destroy();
}).then(function () {
next({ msg: 'Entity unstarred' });
}).catch(next);
});
then
, you have to do everything following inside the one then
) like:// routes/groups.js
function quit(userid, groupid, next) {
return GroupMember.forge({
'userid': userid,
'groupid': groupid
}).fetch()
.then(function (groupMember) {
if (!groupMember) {
return next(errors[40001]);
}
return groupMember.destroy()
.then(function () {
next({
msg: 'quit group success'
});
});
});
}
While using Promise/then, we are encouraged to follow some linear coding (all by my own comprehension)
We all hate "callback hell", don't we? :)
After that I reset password ,I still can login with the old password ina very short time.But latter a minute ,I login faild with old password . It's a bug?
one more field has been transfered into config
so please re copy the config so that test will pass
@huangruichang @ade951
What's the meaning of this code 'user.attributes = user.omit();' in 'routes/users.js' 👍
@huangruichang , @ade951
I fixed it
setup again after pulling
Which should we use with a field, NOT NULL
or NULL
?
Currently I think, allowing NULL
with a field could bring convenience to test. xD
now we have old screenshots in README
@huangruichang
I've found the reason that,
it was the timeout
caused the npm test
problem.
Shown that it takes more than 3000ms for db to setup,
but the default timeout
is 2000ms.
However, I'm still confused -
why it goes so smoothly in WebStorm
with mocha
config well.
@huangruichang
Now we've turned /config
directory into /config.default
,
and added /config
into .gitignore
.
So you can push without worries.
As for the new setup steps, see README.md
.
Have a good time 💯
1)Api in Group : @ade951
it should return more detail(like name,avater.....) of one user in members
2)the entity of Activity @huangruichang
userships
you return .Is it mean "活动名单" in Chinese ?userships
3)Api in Activity @huangruichang
/api/activities/find
starttime
should be number instead of stringstatusid
has been included in status
,so it's redundancy/api/activities/join
method :post "error" invalid api
{ msg: 'issue updated' }
not support Chinese ?
when I use the api like(update,delete),it return an error "Resource not found" .What worry with this?
PS: I hava login in my account and test the post(issue) api successfully.
PSS:May be I'm not well understand the descriction of API reference ?
profile[name] string(45) 姓名
profile[nickname] string(45) 昵称
是否觉得重复呢?这里都是校友,没有那个必要潜水什么的,直接用姓名好了。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.