Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# **/node_modules
.git
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM node:10.12.0
COPY ./ /app
WORKDIR /app
# RUN npm install
EXPOSE 8088
CMD npm run start
4 changes: 2 additions & 2 deletions db/dbConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
*/

const mysql = {
host: 'localhost', // 主机名称,一般是本机
host: '172.17.0.2', // 主机名称,一般是本机 localhost 主机名称是mysql所在的电脑or容器的ipAddress
port: '3306', // 数据库的端口号,如果不设置,默认是3306
user: 'root', // 创建数据库时设置用户名
password: '123456', // 创建数据库时设置的密码
database: 'my_test', // 创建的数据库
database: 'mytest', // 创建的数据库
connectTimeout: 5000 // 连接超时
}

Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "todo-nodejs-api",
"version": "1.0.0",
"description": "NodeJS全栈开发之RESTFUL API基于Node.js+Express+Mysql实现后端接口",
"author": "JackChen <278910933@qq.com>",
"author": "",
"main": "index.js",
"dependencies": {
"body-parser": "^1.19.0",
Expand All @@ -27,7 +27,6 @@
"url": "git+https://github.com/jackchen0120/todo-nodejs-api.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/jackchen0120/todo-nodejs-api/issues"
Expand Down
Loading