CNode

11/05更新:基于 nodejs + express + mongodb 的个人博客程序

Wwillerce发布于14 年前最后回复12 年前55 回复30518 浏览0 收藏

noderce 是一个使用 nodejs 编写的博客程序,使用了 express , jade , mongoskin 等第三方框架、模块。使用 mongodb 做存储。

noderce 的功能很简单。去除了自己用不到的标签、分类、友情链接功能,仅有文章、页面、评论功能。

目前还在完善中,演示地址: http://willerce.com

##安装

克隆项目到本地

git clone git[@github](/user/github).com:willerce/noderce.git

复制一份config.default.js,保存为 config.js,根据注释,修改参数。

定位到项目目录,安装包依赖

npm install -d

运行 node app.js

访问 yourname.com 后,会自动跳转到 yourname.com/admin/install

设定一个用户名密码,程序初始化后,即可使用

2012/9/27:更新存储为 mongodb,使用了 mongoskin 2012/10/13:添加了切换主题功能 2012/11/02:添加了评论模块。 2012/11/05:添加了数据库初始化 2012/11/09:增加了akismet 反 spam 功能

查看回复

回复 (55)

X
xiaojue#1·14 年前

Application Error An error occurred in the application and your page could not be served. Please try again in a few moments.

If you are the application owner, check your logs for details.

。。。

W
willerce#2·14 年前
引用 xiaojueApplication Error An error occurred in the application and your page could not be served. Please...

刚看了一下 log ,没有验证文件是否存在,转换就出问题鸟~

X
xiongliding#3·14 年前

嘿嘿,遇到对手了,我也在用 node, express, markdown 做博客

W
willerce#4·14 年前
引用 xiongliding嘿嘿,遇到对手了,我也在用 node, express, markdown 做博客

发现用 JSON 文件做存储的话,在 Heroku 这样用 Git 部署的云平台会杯具,push 一下,先过的文章就没了。看来还是得换到 mongodb 去

C
cony138#5·14 年前

一样在尝试用node, express, markdown 写博客,只是么有用json文件做持久,还是选mysql了。。

W
willerce#6·14 年前

存储改用 mongo 工程进行中。

W
willerce#7·14 年前

更新存储为 mongodb,使用了 mongoskin

Y
yansong#8·14 年前

我个人是在github上搭的博客。write like a hacker. such as: [http://yansong.me](my blog)

说真的,我自己觉得nodejs不适合用来搭博客的。wordpress已经很强大了,这种重复造轮子的做法很不可取。

也可能我说的都是错的;)

W
willerce#9·14 年前

添加了数据库初始化功能

U
uandur#10·14 年前

就用这个啦。。哈哈

W
willerce#13·14 年前
引用 jaicc楼主的站现在是放在独立空间上?? 我看您的图片不像是引外站的。。 目前也在做站 对于图片存储这里,也在烦空间问题。。。。

@jaicc 呃,是自己的一个独服。只是一个静态资源的站点而已。程序还是扔在 appfog 上。

W
willerce#14·14 年前

新增一个主题。 shuixin,欢迎围观 https://github.com/willerce/noderce

C
chenjinfa#16·13 年前

E:\nodejs>git clone git@github.com:willerce/noderce.git Cloning into 'noderce'... Permission denied (publickey). fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

克隆错误,应该怎么办?

A
anuxs#18·13 年前
引用 chenjinfaE:\nodejs git clone git@github.com:willerce/noderce.git Cloning into 'noderce'... Permission den...

用git协议克隆需要ssl权限,估计你没有配置。那就用http协议: git clone https://github.com/willerce/noderce.git

K
kingapple#21·12 年前
引用 xiongliding嘿嘿,遇到对手了,我也在用 node, express, markdown 做博客

@willerce Heroku 按小时收费,是不是有点贵呢:(

L
lujb#22·12 年前
引用 kooooo@willerce 博客主题很清新,介意我克隆一下么?

这位楼主,若是我现在克隆一下 你会不会去告官?

L
leizongmin#23·14 年前

果断收藏~~~

X
xiaojue#24·14 年前

静态文件速度是快,不过还是建议扔mongo到里吧。

E
elicip#25·14 年前

原来的版本还可以下载么

P
phoenixlzx#26·14 年前

看起来不错,风格用的是哪个?

W
willerce#27·14 年前
引用 elicip原来的版本还可以下载么

原来的版本废弃了。

W
willerce#30·14 年前

给noderce加了评论功能。

M
maliby#31·14 年前

Heroku 收费怎么样?

D
dtrex#32·14 年前

学习学习,O(∩_∩)O~

B
boris#33·14 年前

清爽!

W
willerce#34·14 年前
引用 malibyHeroku 收费怎么样?

现在换到 appfog 了, 这样的小应用,heroku 免费套餐也够用的。

Z
zhengjian#35·14 年前

刚刚试验了下,数据库不知道要怎么配???还有初始的管理员密码是??开启后,数据库连接报错连接不上。。新人求指导~~~谢谢

W
willerce#36·14 年前

羞,我也是新人。 数据库连接,在 config.js 中最后一行,修改它。

exports.db = mongoskin.db(process.env.MONGOLAB_URI || "mongodb://localhost/noderce");

另外,数据库的初始化还没做。捂脸。

所以你自己生成一个 md5 密码。然后

db.user.insert({name:'admin',password:'21232f297a57a5a743894a0e4a801fc3'})

现在,就可以使用 admin admin 登录了。

会尽快加上初始化功能。

S
surgit#37·14 年前

Error: Cannot find module 'gravatar'

I
iamsur123#38·14 年前

不错,下下来看看

S
surgit#39·14 年前
引用 surgitError: Cannot find module 'gravatar'

这个是要安装gravatar?

U
uandur#40·14 年前

博客怎么发图片啊?楼主

W
willerce#41·14 年前
引用 uandur博客怎么发图片啊?楼主

由于现在的 appfog , openshift 之类的都不再提供持久存储了。所以没有考虑文件上传功能。 自己的找个可以直接外链的空间放吧。

W
willerce#42·14 年前
引用 surgitError: Cannot find module 'gravatar'

@surgit 抱歉,package.json 中忘记加上这个了。npm install gravatar 一下吧。评论那一块用到了 gravatar 头像服务。

U
uandur#43·14 年前
引用 uandur博客怎么发图片啊?楼主

@willerce 那你的就可以发图片。。

W
willerce#44·14 年前
引用 uandur博客怎么发图片啊?楼主

@uandur 发表文章的格式是 markdown ,语法参考:http://wowubuntu.com/markdown/

U
uandur#45·14 年前
引用 uandur博客怎么发图片啊?楼主

@willerce 哦了 谢了啊..

J
jaicc#46·14 年前

楼主的站现在是放在独立空间上?? 我看您的图片不像是引外站的。。 目前也在做站 对于图片存储这里,也在烦空间问题。。。。

W
willerce#47·14 年前

有只驴子写了部署在 openshift 的教程:http://hoperce.com/post/openshift-publish

S
shaman#48·14 年前

哈哈,看来做这个东西的人不少哦,看了楼主的相当不错。刚入门nodejs不久,也正在做类似的一个https://github.com/Shaman05/node-blog,希望楼主多多指点 :)

S
shaman#49·14 年前
引用 yansong我个人是在github上搭的博客。write like a hacker. such as: http://yansong.me 说真的,我自己觉得nodejs不适合用来搭博客的。wordpr...

是呀,适不适合做了才知道呢,呵呵。其实就算不适合,对于新手nodejser来说练手蛮不错的,还是能学到不少东西。

S
shaman#50·14 年前
引用 willerce羞,我也是新人。 数据库连接,在 config.js 中最后一行,修改它。 exports.db = mongoskin.db(process.env.MONGOLAB URI || "mon...

囧,我刚开始也是没有考虑到管理员账号创建的问题,后来单独写了个文件添加一个admin,然后删掉后重新部署。

S
synelang#52·14 年前
引用 surgitError: Cannot find module 'gravatar'

@willerce 写好package.json依赖,让大家都npm install就完事搞定

W
willerce#53·14 年前
引用 surgitError: Cannot find module 'gravatar'

@synelang 疏忽了,之前已经更新 package.json

K
kooooo#54·13 年前
引用 jaicc楼主的站现在是放在独立空间上?? 我看您的图片不像是引外站的。。 目前也在做站 对于图片存储这里,也在烦空间问题。。。。

图片可以考虑放在七牛上面,标准用户有免费的额度,如下:

  • 免费存储空间10GB
  • 免费每月下载流量10GB
  • 免费每月PUT/DELETE 10万次请求
  • 免费每月GET 100万次请求

如果不介意的话,可以使用我的推荐链接http://portal.qiniu.com/signup?code=3lea5c9rk89jm

K
kooooo#55·13 年前

@willerce 博客主题很清新,介意我克隆一下么?

参与回复
登录后即可参与回复。登录