Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
solo
Project overview
Project overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
solo
Commits
469846dd
Commit
469846dd
authored
Oct 31, 2015
by
Liang Ding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #12037
parent
349e5627
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
7 deletions
+12
-7
src/main/java/org/b3log/solo/Starter.java
src/main/java/org/b3log/solo/Starter.java
+12
-7
No files found.
src/main/java/org/b3log/solo/Starter.java
View file @
469846dd
...
@@ -18,11 +18,12 @@ package org.b3log.solo;
...
@@ -18,11 +18,12 @@ package org.b3log.solo;
import
java.awt.Desktop
;
import
java.awt.Desktop
;
import
java.io.File
;
import
java.io.File
;
import
java.net.URI
;
import
java.net.URI
;
import
java.util.ResourceBundle
;
import
org.eclipse.jetty.server.Server
;
import
org.eclipse.jetty.server.Server
;
import
org.eclipse.jetty.webapp.WebAppContext
;
import
org.eclipse.jetty.webapp.WebAppContext
;
/**
/**
* Solo with embedded Jetty.
* Solo with embedded Jetty
, <a href="https://github.com/b3log/solo/issues/12037">standalone mode</a>
.
*
*
* <ul>
* <ul>
* <li>Windows: java -cp WEB-INF/lib/*;WEB-INF/classes org.b3log.solo.Solo</li>
* <li>Windows: java -cp WEB-INF/lib/*;WEB-INF/classes org.b3log.solo.Solo</li>
...
@@ -30,7 +31,7 @@ import org.eclipse.jetty.webapp.WebAppContext;
...
@@ -30,7 +31,7 @@ import org.eclipse.jetty.webapp.WebAppContext;
* </ul>
* </ul>
*
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.0.
0, Oct 25
, 2015
* @version 1.0.0.
1, Oct 31
, 2015
* @since 1.2.0
* @since 1.2.0
*/
*/
public
final
class
Starter
{
public
final
class
Starter
{
...
@@ -46,11 +47,13 @@ public final class Starter {
...
@@ -46,11 +47,13 @@ public final class Starter {
final
File
file
=
new
File
(
webappDirLocation
);
final
File
file
=
new
File
(
webappDirLocation
);
if
(!
file
.
exists
())
{
if
(!
file
.
exists
())
{
webappDirLocation
=
"."
;
//
Release
prod env
webappDirLocation
=
"."
;
// prod env
}
}
final
int
port
=
8080
;
// TODO: read from conf
final
ResourceBundle
latke
=
ResourceBundle
.
getBundle
(
"latke"
);
final
String
contextPath
=
"/"
;
// TODO: read from conf
final
int
port
=
Integer
.
valueOf
(
latke
.
getString
(
"serverPort"
));
final
String
contextPath
=
latke
.
getString
(
"contextPath"
);
Server
server
=
new
Server
(
port
);
Server
server
=
new
Server
(
port
);
WebAppContext
root
=
new
WebAppContext
();
WebAppContext
root
=
new
WebAppContext
();
...
@@ -63,14 +66,16 @@ public final class Starter {
...
@@ -63,14 +66,16 @@ public final class Starter {
server
.
start
();
server
.
start
();
final
String
scheme
=
latke
.
getString
(
"serverScheme"
);
final
String
host
=
latke
.
getString
(
"serverHost"
);
try
{
try
{
Desktop
.
getDesktop
().
browse
(
new
URI
(
"http://localhost:"
+
port
));
Desktop
.
getDesktop
().
browse
(
new
URI
(
scheme
+
"://"
+
host
+
":"
+
port
+
contextPath
));
}
catch
(
final
Throwable
e
)
{
}
catch
(
final
Throwable
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
server
.
join
();
server
.
join
();
}
}
/**
/**
...
...
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