Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
Implement cors
Browse files Browse the repository at this point in the history
  • Loading branch information
matteodev8 committed Jul 3, 2024
1 parent cf12fc3 commit e29a969
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const express = require('express');
const cors = require('cors');
const fs = require('fs');
const path = require('path');
const favicon = require('serve-favicon');
Expand Down Expand Up @@ -34,6 +35,7 @@ if (JSON.stringify(originalConfig) !== JSON.stringify(config)) {

const app = express();
app.use(express.json());
app.use(cors());

const port = config.port;

Expand All @@ -45,4 +47,4 @@ app.use('/', mainRoutes);
app.listen(port, () => {
console.log(`🔨 Running peek on port ${port}`);
console.log(`✅ peek is now available under http://127.0.0.1:${port}`);
});
});
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "spkg-peek",
"version": "1.4.0",
"version": "1.4.1",
"description": "API for spkg repositories",
"main": "index.js",
"scripts": {
Expand All @@ -20,6 +20,7 @@
},
"homepage": "https://github.com/Strawberry-Foundations/spkg-peek#readme",
"dependencies": {
"cors": "^2.8.5",
"express": "^4.19.2",
"serve-favicon": "^2.5.0",
"sqlite3": "^5.1.7"
Expand Down

0 comments on commit e29a969

Please sign in to comment.