A Simple Blog Api With Nodejs and Mysql
- Must have XAMPP or Workbench installed.
- Must have redis installed.
- Must have nodejs installed
- Postman for easier testing of
API(Optional)
- Clone or fork repo
- Change directory to slightly_Techie_Blog
cd slightly_Techie_Blog - Install packages `npm install'
- Create your env file using env.sample
- Start server
npm start
Method : POST
url : http://localhost:5000/blog/{api_version}/create/
Body (json)
{ "image":"", "title":"Second Post", "content":"The second post content", "author":"Papa Kow Dadson" }
Method : GET
url : http://localhost:5000/blog/{api_version}/
Method : GET
url : http://localhost:5000/blog/{api_version}/:id
Method : PUT
url : http://localhost:5000/blog/{api_version}/update/:id
Body (json)
{ "title":"First post updated", "content":"The content was just updated" }
Method : DELETE
url : http://localhost:5000/blog/{api_version}/delete/:id
Method : POST
url : http://localhost:5000/blog/{api_version}/prisma/create/
Body (json)
{ "image":"", "title":"Second Post", "content":"The second post content", "author":"Papa Kow Dadson" }
Method : GET
url : http://localhost:5000/blog/{api_version}/prisma/
Method : GET
url : http://localhost:5000/blog/{api_version}/prisma/:id
Method : PUT
url : http://localhost:5000/blog/{api_version}/prisma/update/:id
Body (json)
{ "title":"First post updated", "content":"The content was just updated" }
Method : DELETE
url : http://localhost:5000/blog/{api_version}/prisma/delete/:id
Image upload
- Nodejs(express)
- Mysql
nodemon: Automatic server restartbody-parser: Passing of JSON valuesredis: CachingPrisma: serialization and modellingPrisma - Client
Install nyc globally: npm install -g nyc
Install mocha globally: npm install -g mocha
-
Run Test Code: npm test -
Check coverage: nyc mocha test/**/*.test.js -
Multer: Image Storage -
Docker: Dockerize application: done -
Dockerize redis server
-
Dockerize sql server
-
v1: append v1 after /blog/{v1}/.... to test new endpoints -
kafka: Include logs.