GithubHelp home page GithubHelp logo

qiao / coffee-box Goto Github PK

View Code? Open in Web Editor NEW
71.0 71.0 20.0 949 KB

A blog engine built upon Node.js, Express, MongoDB and CoffeeScript.

Home Page: http://66.228.62.171:3000

CoffeeScript 48.94% JavaScript 51.06%

coffee-box's People

Contributors

layerssss avatar qiao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

coffee-box's Issues

make controllers RESTful

Hi, some of controllers are designated to be used with xhr, but it will be a barrier for implementing third-party themes. So I propose to use a convention to make them work under both XHR and browser POST request:

  • each destroy and update method of contollers should invoke res.redirect 'back' if done
  • error handling should be unified and act like
if req.xhr
  res.statusCode = 400
  res.write err.message
  res.end()
else
  res.flash 'error',err.message
  res.redirect 'back'

SyntaxError: unmatched ] in config.coffee

Here is the stack trace:

  at Function.app.configure.app.use.express.errorHandler.dumpException (/Users/wukaixing/GitHub/coffee-box/config/config.coffee:28:25)
  at Function.app.configure (/Users/wukaixing/GitHub/coffee-box/node_modules/express/lib/application.js:396:61)

启动后,访问页面的时候出现以下错误

localhost:coffee-box liuzhengming$ node index.js
coffee-box server listening on port 3000 in development mode

/Users/liuzhengming/github/coffee-box/node_modules/mongoose/lib/query.js:1312
if (!Array.isArray(arg[i])) throw new Error("Invalid sort() argument.");
^
Error: Invalid sort() argument.
at Query.sort (/Users/liuzhengming/github/coffee-box/node_modules/mongoose/lib/query.js:1312:41)
at Query.setOptions (/Users/liuzhengming/github/coffee-box/node_modules/mongoose/node_modules/mquery/lib/mquery.js:183:20)
at Query.setOptions (/Users/liuzhengming/github/coffee-box/node_modules/mongoose/lib/query.js:859:32)
at Query (/Users/liuzhengming/github/coffee-box/node_modules/mongoose/node_modules/mquery/lib/mquery.js:55:10)
at new Query (/Users/liuzhengming/github/coffee-box/node_modules/mongoose/lib/query.js:65:10)
at Function.find (/Users/liuzhengming/github/coffee-box/node_modules/mongoose/lib/model.js:938:12)
at /Users/liuzhengming/github/coffee-box/app/models/post.coffee:107:20
at Object. (/Users/liuzhengming/github/coffee-box/app/models/post.coffee:89:14)
at Object._onImmediate (/Users/liuzhengming/github/coffee-box/node_modules/mongoose/node_modules/mquery/lib/utils.js:137:16)
at processImmediate as _immediateCallback

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.