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 H20
Team Ad Hoc
4-t-h
Commits
810187c4
Commit
810187c4
authored
Nov 13, 2020
by
Thor-Herman
Browse files
Add urls as variables
#15
parent
f65242e4
Changes
1
Hide whitespace changes
Inline
Side-by-side
prosjekt-4/api/axiosREST.ts
View file @
810187c4
...
...
@@ -5,13 +5,14 @@ import Constants from "expo-constants";
const
{
manifest
}
=
Constants
;
// This gets the IP address of the host for Expo client. Makes you connect to the IP address of the machine on LAN
const
url
=
`http://
${
manifest
.
debuggerHost
.
split
(
'
:
'
).
shift
()}
:8000`
;
const
Localurl
=
`http://
${
manifest
.
debuggerHost
.
split
(
'
:
'
).
shift
()}
:8000`
;
const
VMUrl
=
'
http://it2810-75.idi.ntnu.no:8000
'
;
const
prod
=
{
// The VM backend
url
:
'
http://it2810-75.idi.ntnu.no:8000
'
,
url
:
VMUrl
,
};
const
dev
=
{
// Local backend
url
,
url
:
Localurl
,
// If trying the server locally. Change to Localurl.
};
export
const
config
=
process
.
env
.
NODE_ENV
===
'
development
'
?
dev
:
prod
;
...
...
Thor-Herman Van Eggelen
@theggele
mentioned in commit
a61dfa07
·
Nov 13, 2020
mentioned in commit
a61dfa07
mentioned in commit a61dfa07b591e4c8b918892e24239fafe26875fe
Toggle commit list
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