Re-organize code

This commit is contained in:
wancat committed 2023-07-18 20:33:08 +08:00
1 parent 8901b385ad
commit d51a75e5bc
7 files changed
+7 -5

No files matched your search

+1
View File
@@ -13,6 +13,7 @@
"scripts": {
"app": "yarn workspace app dev",
"server": "yarn workspace server dev",
"cli": "yarn workspace server cli",
"lint": "eslint --ext .js,.vue .",
"format": "prettier --write ."
},
+3 -2
View File
@@ -4,8 +4,9 @@
"description": "Linux Odyssey Server",
"type": "module",
"scripts": {
"start": "node index.js",
"dev": "nodemon index.js"
"start": "node src/index.js",
"dev": "nodemon src/index.js",
"cli": "node src/client.js"
},
"dependencies": {
"dockerode": "^3.3.5",
@@ -1,5 +1,5 @@
import { Server } from 'socket.io'
import { getOrCreateContainer, attachContainer } from './docker.js'
import { getOrCreateContainer, attachContainer } from '../utils/docker.js'
export default (server) => {
const io = new Server(server)
File renamed without changes.
+2 -2
View File
@@ -4,14 +4,14 @@ import http from 'http'
import YAML from 'yaml'
import swaggerUI from 'swagger-ui-express'
import socketServer from './socket.js'
import socketServer from './api/socket.js'
const port = 3000
const app = express()
const server = http.createServer(app)
socketServer(server)
const file = fs.readFileSync('./api/swagger.yaml', 'utf8')
const file = fs.readFileSync('./swagger.yaml', 'utf8')
const swaggerDocument = YAML.parse(file)
app.use('/api-docs', swaggerUI.serve, swaggerUI.setup(swaggerDocument))
File renamed without changes.
File renamed without changes.