File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ export const API_PORT = 3033
Original file line number Diff line number Diff line change 1- import 'dotenv/config'
21import * as jsonServer from 'json-server'
32import { store } from '../../store'
43import type { Server } from 'http'
54import type { Socket } from 'net'
65import { nanoid } from 'nanoid'
6+ import { API_PORT } from '../../../config'
77interface ServerWithDestroy extends Server {
88 destroy : Function
99}
@@ -59,10 +59,8 @@ export const createApiServer = () => {
5959
6060 app . use ( router )
6161
62- const server = app . listen ( process . env . VITE_APP_API_PORT , ( ) => {
63- console . log (
64- `API server is running on port ${ process . env . VITE_APP_API_PORT } `
65- )
62+ const server = app . listen ( API_PORT , ( ) => {
63+ console . log ( `API server is running on port ${ API_PORT } ` )
6664 } ) as ServerWithDestroy
6765
6866 enableDestroy ( server )
Original file line number Diff line number Diff line change 11import { createFetch } from '@vueuse/core'
22import mitt from 'mitt'
33import type { Events } from './types'
4+ import { API_PORT } from '../../config'
45
56export const useApi = createFetch ( {
6- baseUrl : `http://localhost:${ import . meta . env . VITE_APP_API_PORT } `
7+ baseUrl : `http://localhost:${ API_PORT } `
78} )
89
910export const emitter = mitt < Events > ( )
You can’t perform that action at this time.
0 commit comments