Added adminer and simple faux login form
This commit is contained in:
parent
c0facdf922
commit
dbe2dd5238
4 changed files with 39 additions and 1 deletions
|
@ -8,3 +8,14 @@ html
|
||||||
script(src='index.min.js')
|
script(src='index.min.js')
|
||||||
body
|
body
|
||||||
h1 Hello World!
|
h1 Hello World!
|
||||||
|
h2 App under development, please don't send valuable data!
|
||||||
|
form(name="fftcg-login" method="post" action="#")
|
||||||
|
fieldset
|
||||||
|
legend Login-Details
|
||||||
|
div
|
||||||
|
label(for="uname") Username:
|
||||||
|
input(name="uname" required)
|
||||||
|
label(for="password") Password:
|
||||||
|
input(name="password", type="password", placeholder="6 digits, a combination of numbers and letters" required)
|
||||||
|
div
|
||||||
|
input(name="login" type="submit" value="Login")
|
||||||
|
|
|
@ -1,2 +1,10 @@
|
||||||
# init Socket.IO
|
# init Socket.IO
|
||||||
socket = io()
|
socket = io()
|
||||||
|
|
||||||
|
$('form[name="fftcg-login"]').submit ->
|
||||||
|
data =
|
||||||
|
uname: $('input[name="uname"]').val()
|
||||||
|
password: $('input[name="password"]').val()
|
||||||
|
@reset()
|
||||||
|
socket.emit 'login', data
|
||||||
|
false
|
||||||
|
|
|
@ -12,6 +12,17 @@ services:
|
||||||
volumes:
|
volumes:
|
||||||
- "mariadata:/var/lib/mysql"
|
- "mariadata:/var/lib/mysql"
|
||||||
|
|
||||||
|
adminer:
|
||||||
|
image: adminer:standalone
|
||||||
|
restart: "no"
|
||||||
|
environment:
|
||||||
|
- "ADMINER_DESIGN=rmsoft"
|
||||||
|
- "ADMINER_DEFAULT_SERVER=tcgsql"
|
||||||
|
ports:
|
||||||
|
- "8002:8080"
|
||||||
|
|
||||||
|
# dbuser: fftcg
|
||||||
|
# dbpass: juchie5OhH6eiQuujaoquievezoe9iXe
|
||||||
fftcg:
|
fftcg:
|
||||||
build: .
|
build: .
|
||||||
restart: "no"
|
restart: "no"
|
||||||
|
|
10
server.js
10
server.js
|
@ -17,7 +17,7 @@ let io = socketio(web);
|
||||||
|
|
||||||
// Listen server
|
// Listen server
|
||||||
web.listen(8080, function () {
|
web.listen(8080, function () {
|
||||||
console.log('listening on port 8080');
|
console.log('Node.js listening on port 8080');
|
||||||
});
|
});
|
||||||
|
|
||||||
app.use(helmet());
|
app.use(helmet());
|
||||||
|
@ -28,4 +28,12 @@ app.use(express.static(__dirname + '/static'));
|
||||||
// Server logic
|
// Server logic
|
||||||
io.on('connection', function (socket) {
|
io.on('connection', function (socket) {
|
||||||
console.log('a user connected');
|
console.log('a user connected');
|
||||||
|
|
||||||
|
socket.on('disconnect', function(){
|
||||||
|
// console.log('user disconnected');
|
||||||
|
});
|
||||||
|
|
||||||
|
socket.on('login', function(msg){
|
||||||
|
console.log('message:', msg.uname, msg.password);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
Reference in a new issue