Commit 4dc7e755 authored by Duvara Nishaharan's avatar Duvara Nishaharan
Browse files

package

parent 8be490ac
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
"version": "1.0.0", "version": "1.0.0",
"description": "", "description": "",
"main": "app.js", "main": "app.js",
"homepage": "/prosjekt_3",
"scripts": { "scripts": {
"start": "nodemon ./src/app.js", "start": "nodemon ./src/app.js",
"test": "echo \"Error: no test specified\" && exit 1" "test": "echo \"Error: no test specified\" && exit 1"
......
...@@ -26,7 +26,7 @@ const uri = 'mongodb://bruker1:gruppe28@it2810-28.idi.ntnu.no:27017/it2810?authS ...@@ -26,7 +26,7 @@ const uri = 'mongodb://bruker1:gruppe28@it2810-28.idi.ntnu.no:27017/it2810?authS
const options = { useNewUrlParser: true, useUnifiedTopology: true }; const options = { useNewUrlParser: true, useUnifiedTopology: true };
mongoose.connect(uri, options) mongoose.connect(uri, options)
.then(() => app.listen(3001, console.log("Server is active"))) .then(() => app.listen(8081, console.log("Server is active")))
.catch((error) => { .catch((error) => {
throw error throw error
}); });
......
...@@ -3828,11 +3828,6 @@ ...@@ -3828,11 +3828,6 @@
"lodash.uniq": "^4.5.0" "lodash.uniq": "^4.5.0"
} }
}, },
"caniuse-lite": {
"version": "1.0.30001267",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001267.tgz",
"integrity": "sha512-r1mjTzAuJ9W8cPBGbbus8E0SKcUP7gn03R14Wk8FlAlqhH9hroy9nLqmpuXlfKEw/oILW+FGz47ipXV2O7x8lg=="
},
"capture-exit": { "capture-exit": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/capture-exit/-/capture-exit-2.0.0.tgz", "resolved": "https://registry.npmjs.org/capture-exit/-/capture-exit-2.0.0.tgz",
...@@ -15840,4 +15835,4 @@ ...@@ -15840,4 +15835,4 @@
"integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==" "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q=="
} }
} }
} }
\ No newline at end of file
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
"name": "project-3", "name": "project-3",
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"homepage": "/prosjekt_3",
"dependencies": { "dependencies": {
"@navikt/ds-icons": "^0.5.8", "@navikt/ds-icons": "^0.5.8",
"@testing-library/jest-dom": "^5.11.4", "@testing-library/jest-dom": "^5.11.4",
......
...@@ -2,7 +2,7 @@ import axios, {AxiosResponse} from 'axios'; ...@@ -2,7 +2,7 @@ import axios, {AxiosResponse} from 'axios';
import { Country } from '../interfaces/Country'; import { Country } from '../interfaces/Country';
function getData(query: string): Promise<Country[]> { function getData(query: string): Promise<Country[]> {
return axios.get('http://localhost:3001/graphql?query='+query) return axios.get('http://it2810-28.idi.ntnu.no:8081/graphql?query='+query)
.then((response: AxiosResponse) => { .then((response: AxiosResponse) => {
if(response.data.data.country === null ){ if(response.data.data.country === null ){
return [] return []
...@@ -14,7 +14,7 @@ export function getAllData(filter: string=""): Promise<Country[]> { ...@@ -14,7 +14,7 @@ export function getAllData(filter: string=""): Promise<Country[]> {
return getData('{country'+filter+'{name, native, continent, capital, currency, languages}}'); return getData('{country'+filter+'{name, native, continent, capital, currency, languages}}');
} }
function numberOfResults(query: string): Promise<number> { function numberOfResults(query: string): Promise<number> {
return axios.get('http://localhost:3001/graphql?query='+query) return axios.get('http://it2810-28.idi.ntnu.no:8081/graphql?query='+query)
.then((response: AxiosResponse) => { .then((response: AxiosResponse) => {
if(response.data.data.TotalCountires === null ){ if(response.data.data.TotalCountires === null ){
return 0 return 0
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment