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 36
prosjekt4
Commits
8ff9db81
Commit
8ff9db81
authored
Nov 21, 2021
by
Sander Arntzen
Browse files
Endret på port og path
parent
734ba2d8
Changes
6
Hide whitespace changes
Inline
Side-by-side
Backend/config/config.js
View file @
8ff9db81
export
const
PORT
=
808
0
;
export
const
PORT
=
808
1
;
export
const
environment
=
{
serverURL
:
"
mongodb://it2810-36.idi.ntnu.no:27017/?authSource=it2810
"
,
dbString
:
"
mongodb://it2810-36.idi.ntnu.no:27017/?authSource=it2810
"
...
...
Frontend/package.json
View file @
8ff9db81
...
...
@@ -2,7 +2,7 @@
"name"
:
"frontend"
,
"version"
:
"0.1.0"
,
"private"
:
true
,
"homepage"
:
"http://spiller.ingen.rolle.com/movieapp"
,
"homepage"
:
"http://spiller.ingen.rolle.com/movieapp
v4
"
,
"dependencies"
:
{
"@apollo/client"
:
"^3.4.16"
,
"@emotion/react"
:
"^11.5.0"
,
...
...
Frontend/src/App.tsx
View file @
8ff9db81
...
...
@@ -15,10 +15,10 @@ import {ApolloClient, ApolloProvider, from, HttpLink, InMemoryCache} from '@apol
//A way to build GraphQL endpoint to server
const
link
=
from
([
// Denne koden peker til server på den virtuelle maskinen
//new HttpLink({uri: "http://it2810-36.idi.ntnu.no:808
0
/graphql"})
//new HttpLink({uri: "http://it2810-36.idi.ntnu.no:808
1
/graphql"})
// Denne koden peker mot server lokalt på maskinen
new
HttpLink
({
uri
:
"
http://localhost:808
0
/graphql
"
})
new
HttpLink
({
uri
:
"
http://localhost:808
1
/graphql
"
})
])
...
...
@@ -40,8 +40,8 @@ function App() {
<
Header
></
Header
>
<
div
className
=
"container"
>
<
Switch
>
<
Route
path
=
"/movieapp/"
exact
component
=
{
Home
}
/>
<
Route
path
=
"/movieapp/movie/:imdbID"
component
=
{
MovieDetail
}
/>
<
Route
path
=
"/movieapp
v4
/"
exact
component
=
{
Home
}
/>
<
Route
path
=
"/movieapp
v4
/movie/:imdbID"
component
=
{
MovieDetail
}
/>
</
Switch
>
</
div
>
<
Footer
/>
...
...
Frontend/src/__snapshots__/App.test.tsx.snap
View file @
8ff9db81
...
...
@@ -11,7 +11,7 @@ exports[`App component renders page correctly like snapshot 1`] = `
data-testid="header"
>
<a
href="/movieapp/"
href="/movieapp
v4
/"
>
<div
class="logo"
...
...
Frontend/src/components/Header/Header.tsx
View file @
8ff9db81
...
...
@@ -41,12 +41,12 @@ const Header = () => {
const
history
=
useHistory
();
const
searchbarFocused
=
useCallback
(()
=>
{
window
.
location
.
pathname
!==
'
/movieapp/
'
&&
history
.
push
(
'
/movieapp/
'
)
window
.
location
.
pathname
!==
'
/movieapp
v4
/
'
&&
history
.
push
(
'
/movieapp
v4
/
'
)
},
[
history
]);
return
(
<
div
data-testid
=
"header"
className
=
"header"
>
<
Link
to
=
"/movieapp/"
>
<
Link
to
=
"/movieapp
v4
/"
>
<
div
className
=
"logo"
>
Movie App
</
div
>
</
Link
>
<
OutlinedInput
...
...
@@ -64,4 +64,4 @@ const Header = () => {
);
};
export
default
Header
;
\ No newline at end of file
export
default
Header
;
Frontend/src/components/MovieCard/MovieCard.tsx
View file @
8ff9db81
...
...
@@ -8,8 +8,8 @@ const MovieCard = (dataProps: DBMovie) => {
const
history
=
useHistory
();
const
[
imgSrc
,
setImgSrc
]
=
useState
<
string
|
undefined
>
(
dataProps
.
posterurl
)
return
(
<
div
className
=
"card-item"
tabIndex
=
{
10
}
onKeyPress
=
{
()
=>
history
.
push
(
`/movieapp/movie/
${
dataProps
.
id
}
`
)
}
>
<
Link
to
=
{
`/movieapp/movie/
${
dataProps
.
id
}
`
}
>
<
div
className
=
"card-item"
tabIndex
=
{
10
}
onKeyPress
=
{
()
=>
history
.
push
(
`/movieapp
v4
/movie/
${
dataProps
.
id
}
`
)
}
>
<
Link
to
=
{
`/movieapp
v4
/movie/
${
dataProps
.
id
}
`
}
>
<
div
className
=
"card-innter"
>
<
div
className
=
"card-top"
>
<
img
src
=
{
imgSrc
?
imgSrc
:
poster
}
onError
=
{
()
=>
setImgSrc
(
poster
)
}
alt
=
{
`Filmplakat av
${
dataProps
.
title
}
. Illustrasjon.`
}
/>
...
...
@@ -27,4 +27,4 @@ const MovieCard = (dataProps: DBMovie) => {
);
};
export
default
MovieCard
;
\ No newline at end of file
export
default
MovieCard
;
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