Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
order-splitter
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dzptm
order-splitter
Commits
27451bd2
Commit
27451bd2
authored
4 years ago
by
Joni Krebs
Browse files
Options
Downloads
Patches
Plain Diff
added and commented some lines to enable cross-origin requests for HCI
prototype
parent
2c5d30f0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/kotlin/de/dzptm/server/Server.kt
+23
-0
23 additions, 0 deletions
src/main/kotlin/de/dzptm/server/Server.kt
with
23 additions
and
0 deletions
src/main/kotlin/de/dzptm/server/Server.kt
+
23
−
0
View file @
27451bd2
package
de.dzptm.server
package
de.dzptm.server
import
spark.kotlin.before
import
spark.kotlin.options
import
spark.kotlin.port
import
spark.kotlin.port
var
pythonPort
:
String
=
""
var
pythonPort
:
String
=
""
...
@@ -15,6 +17,27 @@ fun main(args: Array<String>) {
...
@@ -15,6 +17,27 @@ fun main(args: Array<String>) {
println
(
"No valid port given... defaulting to 8080."
)
println
(
"No valid port given... defaulting to 8080."
)
}
}
pythonPort
=
if
(
args
.
size
>=
2
)
args
[
1
]
else
"9998"
pythonPort
=
if
(
args
.
size
>=
2
)
args
[
1
]
else
"9998"
// for HCI guys testing only
// options(
// "/*"
// ) {
// val accessControlRequestHeaders: String = request
// .headers("Access-Control-Request-Headers")
// response.header(
// "Access-Control-Allow-Headers",
// accessControlRequestHeaders
// )
// val accessControlRequestMethod: String = request
// .headers("Access-Control-Request-Method")
// response.header(
// "Access-Control-Allow-Methods",
// accessControlRequestMethod
// )
// "OK"
// }
before
{
response
.
header
(
"Access-Control-Allow-Origin"
,
"*"
)
}
Routes
.
register
()
Routes
.
register
()
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment