Skip to content

Commit

Permalink
changed urls to secure api
Browse files Browse the repository at this point in the history
  • Loading branch information
Saim-Akhtar committed Oct 1, 2019
1 parent adf6f02 commit a7aab6f
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 12 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/secured file.txt

/Designs

/front-end/back up
Expand Down
2 changes: 1 addition & 1 deletion front-end/Integration/google-signIn.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function onSignIn(googleUser) {
// console.log("Access Token: " + auth.access_token)

console.log('after response')
const url = "https://node-olx-auction.herokuapp.com/user/oauth/google"
const url = "http://localhost:3000/user/oauth/google"

fetch(url, {
method: 'POST',
Expand Down
2 changes: 1 addition & 1 deletion front-end/Integration/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ let allProducts



const url = "https://node-olx-auction.herokuapp.com/products"
const url = "http://localhost:3000/products"
// On loading , all the products are fetched
fetch(url, {
method: 'GET',
Expand Down
2 changes: 1 addition & 1 deletion front-end/Integration/postingAD.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const sendProduct_request = (productData) => {

productData.userID = getAuthToken.id
console.log(productData)
const url = "https://node-olx-auction.herokuapp.com/products"
const url = "http://localhost:3000/products"
fetch(url, {
method: 'POST',
headers: {
Expand Down
10 changes: 5 additions & 5 deletions front-end/Integration/productPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const index = windowURL.lastIndexOf('productID=') + 10
let productID = windowURL.slice(index, index + 24)
console.log(productID)

const url = "https://node-olx-auction.herokuapp.com/products/" + productID
const url = "http://localhost:3000/products/" + productID
// console.log(url)
fetch(url, {
method: 'GET',
Expand Down Expand Up @@ -218,7 +218,7 @@ const bidProduct = (biddingPrice) => {
biddingData.biddingPrice = biddingPrice
console.log(biddingData)

const url = "https://node-olx-auction.herokuapp.com/products/bidding/" + productData.id
const url = "http://localhost:3000/products/bidding/" + productData.id

fetch(url, {
method: 'PATCH',
Expand Down Expand Up @@ -255,7 +255,7 @@ const modifyBid = (biddingPrice) => {
biddingData.biddingPrice = biddingPrice
console.log(biddingData)

const url = "https://node-olx-auction.herokuapp.com/products/modifyBid/" + productData.id
const url = "http://localhost:3000/products/modifyBid/" + productData.id

fetch(url, {
method: 'PATCH',
Expand Down Expand Up @@ -286,7 +286,7 @@ const modifyBid = (biddingPrice) => {
// when owner deletes a product
const deleteProduct = () => {

const url = "https://node-olx-auction.herokuapp.com/products/delete/" + productData.id
const url = "http://localhost:3000/products/delete/" + productData.id
console.log(url)
fetch(url, {
method: 'DELETE',
Expand Down Expand Up @@ -343,7 +343,7 @@ const send_sellRequest = (buyer) => {
}
console.log(bodyData)

const url = "https://node-olx-auction.herokuapp.com/products/sell/" + productData.id
const url = "http://localhost:3000/products/sell/" + productData.id

fetch(url, {
method: 'PATCH',
Expand Down
4 changes: 2 additions & 2 deletions front-end/Integration/registerPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const login = document.querySelector('#login form')
login.addEventListener('submit', (e) => {
const email = login.email.value
const password = login.password.value
const url = "https://node-olx-auction.herokuapp.com/user/login"
const url = "http://localhost:3000/user/login"
fetch(url, {
method: 'POST',
headers: {
Expand Down Expand Up @@ -69,7 +69,7 @@ register.addEventListener('submit', (e) => {
// Getting the user data and sendin POST request to the server
const sendRegister_request = (userData) => {
console.log(userData)
const url = "https://node-olx-auction.herokuapp.com/user/signup"
const url = "http://localhost:3000/user/signup"
fetch(url, {
method: 'POST',
headers: {
Expand Down
4 changes: 2 additions & 2 deletions front-end/Integration/userProfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ const index = windowURL.lastIndexOf('profileID=') + 10

let userID = windowURL.slice(index, index + 24)
console.log(userID)
const url1 = "https://node-olx-auction.herokuapp.com/user/" + userID
const url2 = "https://node-olx-auction.herokuapp.com/products/user/" + userID
const url1 = "http://localhost:3000/user/" + userID
const url2 = "http://localhost:3000/products/user/" + userID

const fetchRequest1 = fetch(url1, {
method: 'GET',
Expand Down

0 comments on commit a7aab6f

Please sign in to comment.