Switch dev port
This commit is contained in:
@@ -35,7 +35,7 @@ global.pool = pool;
|
|||||||
app.use(express.json());
|
app.use(express.json());
|
||||||
app.use(morgan('combined'));
|
app.use(morgan('combined'));
|
||||||
app.use(cors({
|
app.use(cors({
|
||||||
origin: ['http://localhost:5173', 'http://localhost:5174', 'https://inventory.kent.pw'],
|
origin: ['http://localhost:5175', 'http://localhost:5174', 'https://inventory.kent.pw'],
|
||||||
credentials: true
|
credentials: true
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ const cors = require('cors');
|
|||||||
const corsMiddleware = cors({
|
const corsMiddleware = cors({
|
||||||
origin: [
|
origin: [
|
||||||
'https://inventory.kent.pw',
|
'https://inventory.kent.pw',
|
||||||
'http://localhost:5173',
|
'http://localhost:5175',
|
||||||
/^http:\/\/192\.168\.\d+\.\d+(:\d+)?$/,
|
/^http:\/\/192\.168\.\d+\.\d+(:\d+)?$/,
|
||||||
/^http:\/\/10\.\d+\.\d+\.\d+(:\d+)?$/
|
/^http:\/\/10\.\d+\.\d+\.\d+(:\d+)?$/
|
||||||
],
|
],
|
||||||
@@ -26,7 +26,7 @@ const corsErrorHandler = (err, req, res, next) => {
|
|||||||
res.status(403).json({
|
res.status(403).json({
|
||||||
error: 'CORS not allowed',
|
error: 'CORS not allowed',
|
||||||
origin: req.get('Origin'),
|
origin: req.get('Origin'),
|
||||||
message: 'Origin not in allowed list: https://inventory.kent.pw, localhost:5173, 192.168.x.x, or 10.x.x.x'
|
message: 'Origin not in allowed list: https://inventory.kent.pw, localhost:5175, 192.168.x.x, or 10.x.x.x'
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
next(err);
|
next(err);
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ export default defineConfig(function (_a) {
|
|||||||
},
|
},
|
||||||
server: {
|
server: {
|
||||||
host: "0.0.0.0",
|
host: "0.0.0.0",
|
||||||
port: 5173,
|
port: 5175,
|
||||||
proxy: {
|
proxy: {
|
||||||
"/api": {
|
"/api": {
|
||||||
target: "https://inventory.kent.pw",
|
target: "https://inventory.kent.pw",
|
||||||
@@ -139,7 +139,7 @@ export default defineConfig(function (_a) {
|
|||||||
withCredentials: true,
|
withCredentials: true,
|
||||||
onProxyReq: function (proxyReq, req) {
|
onProxyReq: function (proxyReq, req) {
|
||||||
// Add origin header to match CORS policy
|
// Add origin header to match CORS policy
|
||||||
proxyReq.setHeader('Origin', 'http://localhost:5173');
|
proxyReq.setHeader('Origin', 'http://localhost:5175');
|
||||||
},
|
},
|
||||||
rewrite: function (path) { return path.replace(/^\/auth-inv/, "/auth-inv"); },
|
rewrite: function (path) { return path.replace(/^\/auth-inv/, "/auth-inv"); },
|
||||||
configure: function (proxy, _options) {
|
configure: function (proxy, _options) {
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ export default defineConfig(({ mode }) => {
|
|||||||
},
|
},
|
||||||
server: {
|
server: {
|
||||||
host: "0.0.0.0",
|
host: "0.0.0.0",
|
||||||
port: 5173,
|
port: 5175,
|
||||||
proxy: {
|
proxy: {
|
||||||
"/api": {
|
"/api": {
|
||||||
target: "https://inventory.kent.pw",
|
target: "https://inventory.kent.pw",
|
||||||
@@ -91,7 +91,7 @@ export default defineConfig(({ mode }) => {
|
|||||||
withCredentials: true,
|
withCredentials: true,
|
||||||
onProxyReq: (proxyReq, req) => {
|
onProxyReq: (proxyReq, req) => {
|
||||||
// Add origin header to match CORS policy
|
// Add origin header to match CORS policy
|
||||||
proxyReq.setHeader('Origin', 'http://localhost:5173');
|
proxyReq.setHeader('Origin', 'http://localhost:5175');
|
||||||
},
|
},
|
||||||
rewrite: (path) => path.replace(/^\/auth-inv/, "/auth-inv"),
|
rewrite: (path) => path.replace(/^\/auth-inv/, "/auth-inv"),
|
||||||
configure: (proxy, _options) => {
|
configure: (proxy, _options) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user