Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Tabu-Middleware
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dennis Willers
Tabu-Middleware
Commits
9200cc5f
Commit
9200cc5f
authored
Dec 29, 2020
by
Dennis Willers
🏀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change Table Name
parent
b589c929
Pipeline
#287
passed with stages
in 2 minutes and 7 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
events.js
events.js
+7
-6
No files found.
events.js
View file @
9200cc5f
...
@@ -4,10 +4,11 @@ function createRouter(db) {
...
@@ -4,10 +4,11 @@ function createRouter(db) {
const
router
=
express
.
Router
();
const
router
=
express
.
Router
();
// the routes are defined here
// the routes are defined here
router
.
post
(
'
/addSpielSession
'
,
(
req
,
res
)
=>
{
router
.
post
(
'
/addSession
'
,
(
req
,
res
)
=>
{
var
spielname
=
req
.
body
.
spielname
;
if
(
spielname
.
match
(
/^
[
0-9a-zA-Z
]
+$/
)
!=
null
)
{
if
(
spielname
.
match
(
/^
[
0-9a-zA-Z
]
+$/
)
!=
null
)
{
db
.
query
(
db
.
query
(
'
INSERT INTO S
piels
ession (SessionName) VALUES (
\
"
'
+
spielname
+
'
\
");
'
,
'
INSERT INTO Session (SessionName) VALUES (
\
"
'
+
spielname
+
'
\
");
'
,
(
error
)
=>
{
(
error
)
=>
{
if
(
error
)
{
if
(
error
)
{
console
.
error
(
error
);
console
.
error
(
error
);
...
@@ -22,11 +23,11 @@ function createRouter(db) {
...
@@ -22,11 +23,11 @@ function createRouter(db) {
}
}
});
});
router
.
post
(
'
/isS
pielS
ession
'
,
(
req
,
res
)
=>
{
router
.
post
(
'
/isSession
'
,
(
req
,
res
)
=>
{
var
spielname
=
req
.
body
.
spielname
;
var
spielname
=
req
.
body
.
spielname
;
if
(
spielname
.
match
(
/^
[
0-9a-zA-Z
]
+$/
)
!=
null
)
{
if
(
spielname
.
match
(
/^
[
0-9a-zA-Z
]
+$/
)
!=
null
)
{
db
.
query
(
db
.
query
(
'
SELECT SessionName FROM S
piels
ession WHERE SessionName =
\'
'
+
spielname
+
'
\'
;
'
,
'
SELECT SessionName FROM Session WHERE SessionName =
\'
'
+
spielname
+
'
\'
;
'
,
(
error
,
results
)
=>
{
(
error
,
results
)
=>
{
if
(
error
)
{
if
(
error
)
{
console
.
log
(
error
);
console
.
log
(
error
);
...
@@ -45,9 +46,9 @@ function createRouter(db) {
...
@@ -45,9 +46,9 @@ function createRouter(db) {
}
}
});
});
router
.
get
(
'
/S
pielS
ession
'
,
function
(
req
,
res
)
{
router
.
get
(
'
/Session
'
,
function
(
req
,
res
)
{
db
.
query
(
db
.
query
(
'
SELECT * FROM S
piels
ession
'
,
'
SELECT * FROM Session
'
,
(
error
,
results
)
=>
{
(
error
,
results
)
=>
{
if
(
error
)
{
if
(
error
)
{
console
.
log
(
error
);
console
.
log
(
error
);
...
...
Write
Preview
Markdown
is supported
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