{"id":20582727,"url":"https://github.com/layouwen/nodejs-blog","last_synced_at":"2025-03-06T12:28:26.689Z","repository":{"id":106288534,"uuid":"325333563","full_name":"Layouwen/nodejs-blog","owner":"Layouwen","description":"nodejs blog server. nodejs 博客服务端。","archived":false,"fork":false,"pushed_at":"2024-08-14T07:44:06.000Z","size":423,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-16T22:48:05.996Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Layouwen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-29T16:22:48.000Z","updated_at":"2024-08-14T07:50:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"b64888aa-f983-4aee-9687-464c8bd551ca","html_url":"https://github.com/Layouwen/nodejs-blog","commit_stats":null,"previous_names":["layouwen/nodejs-blob"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Layouwen%2Fnodejs-blog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Layouwen%2Fnodejs-blog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Layouwen%2Fnodejs-blog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Layouwen%2Fnodejs-blog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Layouwen","download_url":"https://codeload.github.com/Layouwen/nodejs-blog/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242209527,"owners_count":20089921,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-16T06:36:52.606Z","updated_at":"2025-03-06T12:28:26.666Z","avatar_url":"https://github.com/Layouwen.png","language":"JavaScript","readme":"# Nodejs Blog\n\nEnglish | [简体中文](./README.zh-CN.md)\n\n## Introduction\n\nThis project is intended for learning how to build a blog backend service using native Node.js or with the help of frameworks like Express or Koa2, in combination with MySQL or MongoDB databases.\n\n## Branches\n\nDifferent branches correspond to different learning topics. The default port for the server is 8080.\n\nFor example:\nPOST `http://localhost:8080/api/user/login`\nBODY `{ \"username\": \"layouwen\", \"password\": \"layouwen\" }`\n\n### master\n\nImplementation using native Node.js with MySQL query string concatenation.\n\n- Configure the `mysql` and `redis` parameters in `src/conf/db.js`.\n- Create the database and tables using `init.sql`.\n- Install dependencies with `npm install`.\n- Start the service with `npm run dev`.\n\n### express\n\nImplementation using Express with MySQL query string concatenation.\n\n- Navigate to the `blog-express` directory.\n- Configure the `mysql` and `redis` parameters in `conf/db.js`.\n- Create the database and tables using `init.sql`.\n- Install dependencies with `npm install`.\n- Start the service with `npm run dev`.\n\n### koa2\n\nImplementation using Koa2 with MySQL query string concatenation.\n\n- Navigate to the `blog-koa2` directory.\n- Configure the `mysql` and `redis` parameters in `conf/db.js`.\n- Create the database and tables using `init.sql`.\n- Install dependencies with `npm install`.\n- Start the service with `npm run dev`.\n\n### mongoose\n\nImplementation using Koa2 with MongoDB.\n\n- Navigate to the `blog-mongoose` directory.\n- Configure the `mongodb` parameters in `db/db.js`.\n- After connecting to the database with `mongodb-compass`, create a document in the `user` collection: `{ \"username\": \"layouwen\", \"password\": \"c6657f3bd287f6092c91a759ca3f5011\" }`.\n- Install dependencies with `npm install`.\n- Start the service with `npm run dev`.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flayouwen%2Fnodejs-blog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flayouwen%2Fnodejs-blog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flayouwen%2Fnodejs-blog/lists"}