mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-08 11:30:12 +08:00
Re-organize code
This commit is contained in:
1 parent
8901b385ad
commit
d51a75e5bc
7 files changed
+7
-5
No files matched your search
@@ -13,6 +13,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"app": "yarn workspace app dev",
|
"app": "yarn workspace app dev",
|
||||||
"server": "yarn workspace server dev",
|
"server": "yarn workspace server dev",
|
||||||
|
"cli": "yarn workspace server cli",
|
||||||
"lint": "eslint --ext .js,.vue .",
|
"lint": "eslint --ext .js,.vue .",
|
||||||
"format": "prettier --write ."
|
"format": "prettier --write ."
|
||||||
},
|
},
|
||||||
|
|||||||
+3
-2
@@ -4,8 +4,9 @@
|
|||||||
"description": "Linux Odyssey Server",
|
"description": "Linux Odyssey Server",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node index.js",
|
"start": "node src/index.js",
|
||||||
"dev": "nodemon index.js"
|
"dev": "nodemon src/index.js",
|
||||||
|
"cli": "node src/client.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"dockerode": "^3.3.5",
|
"dockerode": "^3.3.5",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Server } from 'socket.io'
|
import { Server } from 'socket.io'
|
||||||
import { getOrCreateContainer, attachContainer } from './docker.js'
|
import { getOrCreateContainer, attachContainer } from '../utils/docker.js'
|
||||||
|
|
||||||
export default (server) => {
|
export default (server) => {
|
||||||
const io = new Server(server)
|
const io = new Server(server)
|
||||||
File renamed without changes.
@@ -4,14 +4,14 @@ import http from 'http'
|
|||||||
import YAML from 'yaml'
|
import YAML from 'yaml'
|
||||||
import swaggerUI from 'swagger-ui-express'
|
import swaggerUI from 'swagger-ui-express'
|
||||||
|
|
||||||
import socketServer from './socket.js'
|
import socketServer from './api/socket.js'
|
||||||
|
|
||||||
const port = 3000
|
const port = 3000
|
||||||
const app = express()
|
const app = express()
|
||||||
const server = http.createServer(app)
|
const server = http.createServer(app)
|
||||||
socketServer(server)
|
socketServer(server)
|
||||||
|
|
||||||
const file = fs.readFileSync('./api/swagger.yaml', 'utf8')
|
const file = fs.readFileSync('./swagger.yaml', 'utf8')
|
||||||
const swaggerDocument = YAML.parse(file)
|
const swaggerDocument = YAML.parse(file)
|
||||||
app.use('/api-docs', swaggerUI.serve, swaggerUI.setup(swaggerDocument))
|
app.use('/api-docs', swaggerUI.serve, swaggerUI.setup(swaggerDocument))
|
||||||
|
|
||||||
File renamed without changes.
File renamed without changes.
Reference in new issue
Block a user