Files
linux-odyssey/server/package.json
T
wancat ec90c484b4 feat: add parameters and subcommand to client.js
- Added `"commander": "^11.0.0"` as a dependency in the `package.json` file
- Added an `import { program } from 'commander'` statement in the `client.js` file
- Modified the `createdSession` function in the `client.js` file to use `program.opts().host` instead of `API_ENDPOINT`
- Added a `getSessionList` function in the `client.js` file to fetch the list of sessions
- Added a `lastSession` function in the `client.js` file to get the last session from the session list
- Added a `connect` function in the `client.js` file to establish a socket connection
- Modified the `main` function in the `client.js` file to use `program.opts().session` instead of `process.argv[2]` to get the session ID
- Modified the `main` function in the `client.js` file to use `program.opts().host` instead of `API_ENDPOINT` to initialize the socket connection
- Added a `program` object with options and actions in the `client.js` file
- Added `.bash_history` to the `.gitignore` file
- Added `.viminfo` to the `.gitignore` file
- Added `*.swp` to the `.gitignore` file

Signed-off-by: wancat <wancat@wancat.cc>
2023-07-31 15:42:58 +08:00

29 lines
674 B
JSON

{
"name": "server",
"version": "0.0.0",
"description": "Linux Odyssey Server",
"type": "module",
"scripts": {
"start": "node src/index.js",
"dev": "nodemon src/index.js",
"cli": "node src/client.js",
"test": "yarn node --experimental-vm-modules $(yarn bin jest)"
},
"dependencies": {
"commander": "^11.0.0",
"dockerode": "^3.3.5",
"express": "^4.18.2",
"jsonwebtoken": "^9.0.1",
"marked": "^5.1.1",
"mongoose": "^7.4.0",
"socket.io": "^4.7.1",
"socket.io-client": "^4.7.1",
"swagger-ui-express": "^5.0.0",
"yaml": "^2.3.1"
},
"devDependencies": {
"jest": "^29.6.1",
"nodemon": "^3.0.1"
}
}