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
2023-07-15 15:30:42 +08:00
2023-07-20 17:05:01 +08:00
2023-07-26 00:12:10 +08:00
2023-07-20 17:05:01 +08:00

Linux Odyssey

Requirements

  • NodeJS
  • Docker
  • Yarn

Installation

git clone https://github.com/lancatlin/linux-odyssey.git
cd linux-odyssey
yarn install

Create database

docker compose up -d

Server

Source: server/

yarn server
# Open http://localhost:3000

App

Source: app/

yarn app
# Open http://localhost:5173/

CLI terminal client

Open server first, then create a session by POST /api/v1/sessions

curl -X 'POST' \
  'http://localhost:3000/api/v1/sessions' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "quest_id": "helloworld"
}'

Then use the _id field in response

yarn cli [_id]
# example
yarn cli 64be226a39c0043cd1cdf7c2
S
Description
No description provided
Readme GPL-3.0
8.1 MiB
0 Stars 1 Watchers 0 Forks
Languages
TypeScript 64%
Vue 24.2%
Go 4.2%
Shell 2.1%
Handlebars 2.1%
Other 3.3%