Skip to content

Commit

Permalink
Remove vercel server
Browse files Browse the repository at this point in the history
  • Loading branch information
catherineisonline committed Jul 25, 2024
1 parent 91a8151 commit e11ed9d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const mainElement = document.querySelector(".main-container");
// Other
let resultSkeleton = '';
let resultStorage = [];
const BACKEND_URL = "https://pizza-time-backend.vercel.app/users";

//URL Validiation
function urlValidation(defaultUrl) {
Expand Down Expand Up @@ -44,10 +43,11 @@ shortlyBtn.addEventListener("click", (e) => {
}
});
function fetchBackupUrl(inputValue) {
fetch(`${BACKEND_URL}?url=${encodeURIComponent(inputValue)}`)
fetch(`https://ulvis.net/API/write/get?url=${encodeURIComponent(inputValue)}`)
.then((response) => response.json())
.then((response) => {
if (response.data) {
console.log(response.data)
let shortlyCode = response.data.url;
resultSkeleton = `<div class="result">
<p class="inserted-link">${inputValue}</p>
Expand Down
4 changes: 2 additions & 2 deletions server.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import cors from 'cors';
import fetch from 'node-fetch';
const app = express();
const port = 3000;
const BACKEND_URL = process.env.BACKEND_URL;

const SHORTENER_API_URL = process.env.SHORTENER_API_URL;
app.use(cors());
app.use(json());
Expand All @@ -12,7 +12,7 @@ app.get('/', (req, res) => {
res.send('Server Deployed 🥳');
});

app.get(`/users`, async (req, res) => {
app.get(`/shortener`, async (req, res) => {
const { url } = req.query;

if (!url) {
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"module": "ESNext",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
Expand Down

0 comments on commit e11ed9d

Please sign in to comment.