{"id":16582722,"url":"https://github.com/nodejh/express-example","last_synced_at":"2025-07-09T19:34:02.984Z","repository":{"id":90786502,"uuid":"79980642","full_name":"nodejh/express-example","owner":"nodejh","description":"Express 示例网站","archived":false,"fork":false,"pushed_at":"2017-02-14T01:49:24.000Z","size":593,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-06T02:43:36.203Z","etag":null,"topics":["express"],"latest_commit_sha":null,"homepage":null,"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/nodejh.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":"2017-01-25T03:44:45.000Z","updated_at":"2023-01-08T15:07:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"45e40020-04c0-4057-8f9c-0ec1c180be52","html_url":"https://github.com/nodejh/express-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nodejh/express-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodejh%2Fexpress-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodejh%2Fexpress-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodejh%2Fexpress-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodejh%2Fexpress-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nodejh","download_url":"https://codeload.github.com/nodejh/express-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodejh%2Fexpress-example/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264502490,"owners_count":23618617,"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":["express"],"created_at":"2024-10-11T22:33:51.580Z","updated_at":"2025-07-09T19:34:02.622Z","avatar_url":"https://github.com/nodejh.png","language":"JavaScript","readme":"# Express 示例网站\n\n该示例网站的特点：\n\n+ ES6 语法\n+ Aribnb ESLint 语法检查\n+ MySQL 数据库连接\n\n\n# Branches\n\n## es6\n\nES6 语法的基本示例网站。不包数据库等其他配置。\n\n```\n$ git clone https://github.com/nodejh/express-example -b es6\n$ cd express-example\n$ npm install\n$ npm start\n```\n\n## MySQL\n\n使用 MySQL 数据库的示例网站。连接 MySQL 的包：\n\n+ [mysql](https://www.npmjs.com/package/mysql)\n+ [express-myconnection](https://www.npmjs.com/package/express-myconnection)\n\n\n#### 下载代码\n\n```\n$ git clone https://github.com/nodejh/express-example -b mysql\n$ cd express-example\n```\n\n#### 导入数据库文件\n\n```\n$ mysql -uroot -p \u003c express-example/databases/example.sql\n```\n\n#### 修改数据库配置\n\n```\n// config/config.js\ndb: {\n  host: 'localhost',\n  user: 'root',\n  password: 'root',\n  port: 3306,\n  database: 'express_example',\n},\n```\n\n#### 启动\n\n```\n$ npm install\n$ npm start\n```\n\n\n## BootStrap\n\n\n\n## session\n\n使用 session 主要有两步：\n\n+ 初始化 session，详见 `app.js` 第 9 行、第 27 行和第 46 行\n+ 使用 session，详见 `routes/index.js` 第 117 行\n\nsession 主要用到了 [express-session](https://github.com/expressjs/session) 这个包。\n\n+ [英文文档](https://github.com/expressjs/session)\n+ [中文文档](https://www.xgllseo.com/?p=5162)\n+ [关于 session 和 cookie 的讲解](https://github.com/alsotang/node-lessons/tree/master/lesson16)\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnodejh%2Fexpress-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnodejh%2Fexpress-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnodejh%2Fexpress-example/lists"}