Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Switcheversenken
Switcheversenken Frontend
Commits
05fb31d4
Commit
05fb31d4
authored
Oct 07, 2020
by
satan
Browse files
added config
parent
322f4754
Changes
3
Hide whitespace changes
Inline
Side-by-side
rollup.config.js
View file @
05fb31d4
...
...
@@ -10,7 +10,7 @@ import { terser } from "rollup-plugin-terser";
const
production
=
process
.
env
.
NODE_ENV
===
"
production
"
;
export
default
{
input
:
[
"
src/main.ts
"
],
input
:
[
"
src/main.ts
"
,
"
src/config.ts
"
],
output
:
{
format
:
"
esm
"
,
dir
:
"
build
"
,
...
...
src/App.vue
View file @
05fb31d4
...
...
@@ -45,6 +45,7 @@
import
{
reactive
,
ref
,
unref
,
computed
,
onMounted
,
watch
}
from
"
vue
"
;
import
{
Cell
,
getCell
,
setCell
,
Grid
}
from
"
./gameLogic
"
;
import
VGrid
from
"
./components/Grid.vue
"
;
import
*
as
config
from
"
./config
"
;
const
required
=
{
1
:
0
,
...
...
@@ -83,7 +84,7 @@ export default {
});
setInterval
(
async
()
=>
{
const
resp
=
await
fetch
(
"
/api/gamephase
"
);
const
resp
=
await
fetch
(
config
.
BASE_URL
+
"
/api/gamephase
"
);
const
{
phase
:
p
}
=
await
resp
.
json
();
if
(
phase
.
value
===
"
ready
"
)
{
return
;
...
...
@@ -101,7 +102,7 @@ export default {
F
:
Cell
.
WATER
};
fetch
(
"
/api/grid/my
"
)
fetch
(
config
.
BASE_URL
+
"
/api/grid/my
"
)
.
then
(
r
=>
r
.
json
())
.
then
(
json
=>
{
for
(
const
{
x
,
y
,
state
}
of
json
)
{
...
...
@@ -109,7 +110,7 @@ export default {
}
});
fetch
(
"
/api/grid/other
"
)
fetch
(
config
.
BASE_URL
+
"
/api/grid/other
"
)
.
then
(
r
=>
r
.
json
())
.
then
(
json
=>
{
for
(
const
{
x
,
y
,
state
}
of
json
)
{
...
...
@@ -125,7 +126,7 @@ export default {
myGrid
.
reset
();
break
;
case
"
ready
"
:
fetch
(
"
/api/ready
"
,
{
fetch
(
config
.
BASE_URL
+
"
/api/ready
"
,
{
method
:
"
POST
"
,
headers
:
{
"
Content-Type
"
:
"
application/json
"
...
...
src/config.ts
0 → 100644
View file @
05fb31d4
export
const
BASE_URL
=
"
http://localhost:5000
"
;
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