chore: Indent, phrasing

parent f6e98fcf
<template>
<div id="app">
<img alt="Vue logo" src="./assets/logo.png" />
<HelloWorld msg="Welcome to Menteur!" />
<ListenToSockets />
</div>
<div id="app">
<HelloWorld msg="Salut Menteur !"/>
<ListenToSockets/>
</div>
</template>
<script>
import Vue from 'vue'
import Vuex from 'vuex'
import 'es6-promise/auto' // Needed for Promise polyfill
import Vue from 'vue'
import Vuex from 'vuex'
import 'es6-promise/auto' // Needed for Promise polyfill
import VueSocketIO from 'vue-socket.io'
// import Game from "./components/Game";
import HelloWorld from "./components/HelloWorld";
import ListenToSockets from "./Sockets";
import VueSocketIO from 'vue-socket.io'
Vue.use(Vuex);
// import Game from "./components/Game";
import HelloWorld from "./components/HelloWorld";
import ListenToSockets from "./ListenToSockets";
const store = new Vuex.Store({
state: {
count: 0
},
mutations: {
increment(state) {
state.count++
},
decrement(state) {
state.count++
}
}
// TODO: Use actions for VueX-SocketIO integration?
// actions: {
// "<ACTION_PREFIX><EVENT_NAME>"() {
// // do something
// }
// }
});
Vue.use(Vuex);
const store = new Vuex.Store({
state: {
count: 0
},
mutations: {
increment (state) {
state.count++
},
decrement (state) {
state.count++
}
}
// TODO: Use actions for VueX-SocketIO integration?
// actions: {
// "<ACTION_PREFIX><EVENT_NAME>"() {
// // do something
// }
// }
});
Vue.use(new VueSocketIO({
debug: true,
connection: 'http://localhost:9042',
vuex: {
store,
actionPrefix: 'SOCKET_',
mutationPrefix: 'SOCKET_'
},
options: {path: "/socket.io/"} //Optional options
}));
Vue.use(new VueSocketIO({
debug: true,
connection: 'http://localhost:9042',
vuex: {
store,
actionPrefix: 'SOCKET_',
mutationPrefix: 'SOCKET_'
},
options: { path: "/socket.io/" } //Optional options
}));
export default {
name: "App",
components: {
HelloWorld,
ListenToSockets
}
};
export default {
name: "App",
components: {
HelloWorld,
ListenToSockets
}
};
</script>
<style>
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
</style>
<template>
<div class="hello">
<h1>Hello Vue! {{ msg }}</h1>
<p>
For a guide and recipes on how to configure / customize this project,<br />
check out the
<a href="https://cli.vuejs.org" target="_blank" rel="noopener"
>vue-cli documentation</a
>.
</p>
<h3>Installed CLI Plugins</h3>
<ul>
<li>
<a
href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel"
target="_blank"
rel="noopener"
>babel</a
>
</li>
<li>
<a
href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint"
target="_blank"
rel="noopener"
>eslint</a
>
</li>
</ul>
</div>
<div class="hello">
<h1>{{ msg }}</h1>
</div>
</template>
<script>
export default {
name: "HelloWorld",
props: {
msg: String
}
};
export default {
name: "HelloWorld",
props: {
msg: String
}
};
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h3 {
margin: 40px 0 0;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
h3 {
margin: 40px 0 0;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
</style>
......@@ -3,8 +3,8 @@ from http.client import HTTPException
import socketio
from fastapi import FastAPI, APIRouter
from fastapi.exceptions import RequestValidationError
from starlette.responses import PlainTextResponse
from starlette.exceptions import HTTPException
from starlette.responses import PlainTextResponse
from server.model.data import Game
# Game state
......@@ -16,6 +16,14 @@ game = Game()
# Server
app = FastAPI()
router = APIRouter()
#
# app.add_middleware(
# CORSMiddleware,
# allow_origins=["*"],
# allow_credentials=True,
# allow_methods=["*"],
# allow_headers=["*"],
# )
# Create and mount SocketIO app
sio_asgi_app = socketio.ASGIApp(
......
......@@ -3,9 +3,10 @@ import socketio
sio = socketio.AsyncServer(
async_mode='asgi',
logger=True,
cors_allowed_origins="*" # FIXME: CSRF Vulnerability
cors_allowed_origins="*" # FIXME: CSRF Vulnerability
)
@sio.event
def connect(sid, environ):
print("connect ", sid, environ)
......
Markdown is supported
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