Skip to content

Commit

Permalink
use cors for limiting access
Browse files Browse the repository at this point in the history
  • Loading branch information
petertimwalker committed May 26, 2024
1 parent 35f2a20 commit d5feb06
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ const app = express();
const PORT = process.env.PORT || 443;

// Use CORS middleware to allow requests from all origins
app.use(cors());
app.use(cors({
origin: 'https://peterwalker.xyz',
}));

// Store your API key securely in an environment variable
const API_KEY = process.env.API_KEY || 'API_KEY not defined';
Expand Down

0 comments on commit d5feb06

Please sign in to comment.