Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
IT2810 H21
Team 28
project-3
Commits
4dc7e755
Commit
4dc7e755
authored
Nov 01, 2021
by
Duvara Nishaharan
Browse files
package
parent
8be490ac
Changes
5
Show whitespace changes
Inline
Side-by-side
project-3/backend/package.json
View file @
4dc7e755
...
...
@@ -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"
...
...
project-3/backend/src/app.js
View file @
4dc7e755
...
...
@@ -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
(
300
1
,
console
.
log
(
"
Server is active
"
)))
.
then
(()
=>
app
.
listen
(
808
1
,
console
.
log
(
"
Server is active
"
)))
.
catch
((
error
)
=>
{
throw
error
});
...
...
project-3/package-lock.json
View file @
4dc7e755
...
...
@@ -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",
...
...
project-3/package.json
View file @
4dc7e755
...
...
@@ -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"
,
...
...
project-3/src/utils/APIUtil.tsx
View file @
4dc7e755
...
...
@@ -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:300
1/graphql?query=
'
+
query
)
return
axios
.
get
(
'
http://
it2810-28.idi.ntnu.no:808
1/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:300
1/graphql?query=
'
+
query
)
return
axios
.
get
(
'
http://
it2810-28.idi.ntnu.no:808
1/graphql?query=
'
+
query
)
.
then
((
response
:
AxiosResponse
)
=>
{
if
(
response
.
data
.
data
.
TotalCountires
===
null
){
return
0
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment