Skip to content

Commit 07d7f8c

Browse files
committed
fix(main: api): path resolve
1 parent f468224 commit 07d7f8c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/services/api/server.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import type { Server } from 'http'
44
import type { Socket } from 'net'
55
import { nanoid } from 'nanoid'
66
import { API_PORT } from '../../config'
7+
import path from 'path'
78
interface ServerWithDestroy extends Server {
89
destroy: Function
910
}
@@ -28,7 +29,7 @@ const enableDestroy = (server: ServerWithDestroy) => {
2829
}
2930

3031
export const createApiServer = () => {
31-
const db = store.preferences.get('storagePath') + '/db.json'
32+
const db = path.resolve(store.preferences.get('storagePath') + '/db.json')
3233
const app = jsonServer.create()
3334
const middlewares = jsonServer.defaults()
3435
const router = jsonServer.router(db)

0 commit comments

Comments
 (0)