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

package

parent 8be490ac
......@@ -3,6 +3,7 @@
"version": "1.0.0",
"description": "",
"main": "app.js",
"homepage": "/prosjekt_3",
"scripts": {
"start": "nodemon ./src/app.js",
"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
const options = { useNewUrlParser: true, useUnifiedTopology: true };
mongoose.connect(uri, options)
.then(() => app.listen(3001, console.log("Server is active")))
.then(() => app.listen(8081, console.log("Server is active")))
.catch((error) => {
throw error
});
......
......@@ -3828,11 +3828,6 @@
"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": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/capture-exit/-/capture-exit-2.0.0.tgz",
......
......@@ -2,6 +2,7 @@
"name": "project-3",
"version": "0.1.0",
"private": true,
"homepage": "/prosjekt_3",
"dependencies": {
"@navikt/ds-icons": "^0.5.8",
"@testing-library/jest-dom": "^5.11.4",
......
......@@ -2,7 +2,7 @@ import axios, {AxiosResponse} from 'axios';
import { Country } from '../interfaces/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) => {
if(response.data.data.country === null ){
return []
......@@ -14,7 +14,7 @@ export function getAllData(filter: string=""): Promise<Country[]> {
return getData('{country'+filter+'{name, native, continent, capital, currency, languages}}');
}
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) => {
if(response.data.data.TotalCountires === null ){
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