A lightweight blog framework
We use Node and MongoDB
-
Download this package
cd freeblog
-
Make sure
"node": ">=0.8.0 <12.0.0"
nvm install 10 nvm use 10
-
Install dependencies
npm install
-
Copy a
config
fromconfig.example
Modify some configuration inside as you needcp -r config.example config
NOTICE: You should update the
admin
information -
Make sure MongoDB is running
# npm run mongo3 docker run --rm -it -p 127.0.0.1:27017:27017 -v ~/docker-data/local-mongo3:/data/db --name mongo3 mongo:3 # or # npm run mongo4 # npm run mongo5
-
Initialize database
cp -r content.example content node setup
-
Run it
node app
And then visit
http://localhost:8008
Visit http://localhost:8008/admin
Post a request just with the form
Available REST API:
- Posts [ title, body ]
- POST
/api/posts
- PUT
/api/posts/:postid
- DELETE
/api/posts/:postid
- POST
- Posts - Comment [ name, body ]
- POST
/api/posts/:postid/comments
- PUT
/api/posts/:postid/comments/:commentid
- DELETE
/api/posts/:postid/:commentid
- POST
- Albums [ title ]
- POST
/api/albums
- PUT
/api/albums/:albumid
- DELETE
/api/albums/:albumid
- POST
- Album - Pictures [ image(file), desc ]
- POST
/api/albums/:albumid/pictures
- PUT
/api/albums/:albumid/pictures/:pictureid
- DELETE
/api/albums/:albumid/pictures/:pictureid
- POST