mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-05 19:20: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
+3
-2
@@ -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.
@@ -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.
Reference in new issue
Block a user