Skip to content

Commit

Permalink
cors update
Browse files Browse the repository at this point in the history
  • Loading branch information
mohammadshahidbeigh committed Oct 21, 2024
1 parent bddd0bf commit 0611ffa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions mindvault-backend/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,13 @@ dotenv.config();

const app: Application = express();

// Enable CORS
app.use(cors());
// Enable CORS with specific origin
app.use(
cors({
origin: "http://43.205.10.7:3000",
credentials: true,
})
);

// Use morgan for logging requests
app.use(morgan("combined")); // You can change the format as needed
Expand Down
2 changes: 1 addition & 1 deletion src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const authLink = new ApolloLink((operation, forward) => {
const client = new ApolloClient({
link: ApolloLink.from([
authLink,
new HttpLink({uri: "http://localhost:4000/graphql"}), // Replace with your GraphQL API URL
new HttpLink({uri: "http://43.205.10.7:4000/graphql"}), // Replace with your GraphQL API URL
]),
cache: new InMemoryCache(),
});
Expand Down

0 comments on commit 0611ffa

Please sign in to comment.