-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update dependencies
- Loading branch information
Showing
16 changed files
with
394 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,8 @@ | ||
VITE_APP_API_URL=https://api.bulletproofapp.com | ||
VITE_APP_API_URL=http://localhost:8080/api | ||
VITE_APP_ENABLE_API_MOCKING=true | ||
|
||
|
||
# If you want to run standalone mock server, you can use the following configuration: | ||
# VITE_APP_ENABLE_API_MOCKING=false | ||
# VITE_APP_MOCK_API_PORT=8080 | ||
# VITE_APP_URL=http://localhost:3000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,3 +34,7 @@ npm-debug.log* | |
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
|
||
# local | ||
mocked-db.json | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { createMiddleware } from '@mswjs/http-middleware'; | ||
import cors from 'cors'; | ||
import express from 'express'; | ||
import logger from 'pino-http'; | ||
|
||
import { env } from './src/config/env'; | ||
import { handlers } from './src/testing/mocks/handlers'; | ||
|
||
const app = express(); | ||
|
||
app.use( | ||
cors({ | ||
origin: env.APP_URL, | ||
credentials: true, | ||
}), | ||
); | ||
|
||
app.use(express.json()); | ||
app.use(logger()); | ||
app.use(createMiddleware(...handlers)); | ||
|
||
app.listen(env.APP_MOCK_API_PORT, () => { | ||
console.log( | ||
`Mock API server started at http://localhost:${env.APP_MOCK_API_PORT}`, | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.