feat: proje secimi ve otomatik ekip akisini ekle
This commit is contained in:
@@ -4,6 +4,7 @@ import path from "path";
|
||||
import { fileURLToPath } from "url";
|
||||
import { Server } from "socket.io";
|
||||
import { getPublicRuntimeConfig, getRuntimeConfig } from "./config.js";
|
||||
import { selectProjectFolder } from "./projectPicker.js";
|
||||
import { SessionManager } from "./sessionManager.js";
|
||||
import { registerSocketHandlers } from "./socketHandlers.js";
|
||||
|
||||
@@ -21,6 +22,8 @@ const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
const webDistPath = path.resolve(__dirname, "../web/dist");
|
||||
|
||||
app.use(express.json());
|
||||
|
||||
app.get("/health", (req, res) => {
|
||||
res.json({
|
||||
ok: true,
|
||||
@@ -37,6 +40,22 @@ app.get("/api/session/state", (req, res) => {
|
||||
});
|
||||
});
|
||||
|
||||
app.post("/api/project/select", async (req, res) => {
|
||||
try {
|
||||
const selectedPath = req.body?.projectPath ? String(req.body.projectPath) : await selectProjectFolder();
|
||||
await sessionManager.setProjectPath(selectedPath);
|
||||
res.json({
|
||||
ok: true,
|
||||
projectPath: sessionManager.getState().currentProjectPath
|
||||
});
|
||||
} catch (error) {
|
||||
res.status(500).json({
|
||||
ok: false,
|
||||
error: error.message
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
if (config.nodeEnv === "production") {
|
||||
app.use(express.static(webDistPath));
|
||||
app.get("*", (req, res) => {
|
||||
|
||||
Reference in New Issue
Block a user