Skip to content

Commit

Permalink
fix(main: api): path resolve
Browse files Browse the repository at this point in the history
  • Loading branch information
antonreshetov committed Mar 31, 2022
1 parent f468224 commit 07d7f8c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/services/api/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import type { Server } from 'http'
import type { Socket } from 'net'
import { nanoid } from 'nanoid'
import { API_PORT } from '../../config'
import path from 'path'
interface ServerWithDestroy extends Server {
destroy: Function
}
Expand All @@ -28,7 +29,7 @@ const enableDestroy = (server: ServerWithDestroy) => {
}

export const createApiServer = () => {
const db = store.preferences.get('storagePath') + '/db.json'
const db = path.resolve(store.preferences.get('storagePath') + '/db.json')
const app = jsonServer.create()
const middlewares = jsonServer.defaults()
const router = jsonServer.router(db)
Expand Down

0 comments on commit 07d7f8c

Please sign in to comment.