jsantell/poet — pull request #85 by renjiexu (2014-04-10 07:25:22+00:00)
Title: mongodb support

Hi,
I saw we had some discussion in #53 about db support. I am new to node.js, mongodb (and even front-end), so I decide to try this for fun.

In order to use mongodb, I added 'storageType', 'mongoUri', 'dbRefreshInterval' three additional fields (see example in mongoSetup.js). User can choose either 'database' or 'filesystem', though just a couple of lines change can make it to load from both; watcher works by using timer.

Right now, the only option of create/update/delete posts is by editing database directly (in mongoSetup, I pointed it to a demo db running on mongohq, and I will just leave it there for demo). Therefore, an editor might be a good idea for next step, then access control to avoid other user to create/editor posts might be next->next step, then...=_=||

Please let me know if you have any suggestions, and if you see anything wrong about my code, i.e) code style, logic, grammar etc, please point it out. Thanks!

(Jordan, thanks for writing such as great blog engine!)

btw, my code also had the fix made by Matt in #55, #77ca309. I think it should be merged to fix 'deleted posts were not gone' bug.