Make port configurable
This commit is contained in:
parent
decc0598b1
commit
cf11c6bc1d
@ -1,5 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
|
<component name="GradleMigrationSettings" migrationVersion="1" />
|
||||||
<component name="GradleSettings">
|
<component name="GradleSettings">
|
||||||
<option name="linkedExternalProjectsSettings">
|
<option name="linkedExternalProjectsSettings">
|
||||||
<GradleProjectSettings>
|
<GradleProjectSettings>
|
||||||
|
@ -5,9 +5,8 @@
|
|||||||
</component>
|
</component>
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="ceecbd3e-6a84-488d-ae73-a0b5b3f4010e" name="Changes" comment="">
|
<list default="true" id="ceecbd3e-6a84-488d-ae73-a0b5b3f4010e" name="Changes" comment="">
|
||||||
|
<change beforePath="$PROJECT_DIR$/.idea/gradle.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/gradle.xml" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/main/java/tech/nevets/ngxinstaller/Server.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/tech/nevets/ngxinstaller/Server.java" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/src/main/java/tech/nevets/ngxinstaller/TextStorage.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/tech/nevets/ngxinstaller/TextStorage.java" afterDir="false" />
|
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
@ -63,9 +62,9 @@
|
|||||||
<component name="MarkdownSettingsMigration">
|
<component name="MarkdownSettingsMigration">
|
||||||
<option name="stateVersion" value="1" />
|
<option name="stateVersion" value="1" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectColorInfo"><![CDATA[{
|
<component name="ProjectColorInfo">{
|
||||||
"associatedIndex": 0
|
"associatedIndex": 0
|
||||||
}]]></component>
|
}</component>
|
||||||
<component name="ProjectId" id="2Zm8KgH0I3o9715Y3ZzBs94Smav" />
|
<component name="ProjectId" id="2Zm8KgH0I3o9715Y3ZzBs94Smav" />
|
||||||
<component name="ProjectLevelVcsManager" settingsEditedManually="true">
|
<component name="ProjectLevelVcsManager" settingsEditedManually="true">
|
||||||
<ConfirmationsSetting value="2" id="Add" />
|
<ConfirmationsSetting value="2" id="Add" />
|
||||||
@ -74,22 +73,22 @@
|
|||||||
<option name="hideEmptyMiddlePackages" value="true" />
|
<option name="hideEmptyMiddlePackages" value="true" />
|
||||||
<option name="showLibraryContents" value="true" />
|
<option name="showLibraryContents" value="true" />
|
||||||
</component>
|
</component>
|
||||||
<component name="PropertiesComponent"><![CDATA[{
|
<component name="PropertiesComponent">{
|
||||||
"keyToString": {
|
"keyToString": {
|
||||||
"Gradle.NginxInstallerBackend [:Server.main()].executor": "Debug",
|
"Gradle.NginxInstallerBackend [:Server.main()].executor": "Debug",
|
||||||
"Gradle.NginxInstallerBackend [shadowJar].executor": "Run",
|
"Gradle.NginxInstallerBackend [shadowJar].executor": "Run",
|
||||||
"RunOnceActivity.OpenProjectViewOnStart": "true",
|
"RunOnceActivity.OpenProjectViewOnStart": "true",
|
||||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||||
"ignore.virus.scanning.warn.message": "true",
|
"ignore.virus.scanning.warn.message": "true",
|
||||||
"kotlin-language-version-configured": "true",
|
"kotlin-language-version-configured": "true",
|
||||||
"node.js.detected.package.eslint": "true",
|
"node.js.detected.package.eslint": "true",
|
||||||
"node.js.detected.package.tslint": "true",
|
"node.js.detected.package.tslint": "true",
|
||||||
"node.js.selected.package.eslint": "(autodetect)",
|
"node.js.selected.package.eslint": "(autodetect)",
|
||||||
"node.js.selected.package.tslint": "(autodetect)",
|
"node.js.selected.package.tslint": "(autodetect)",
|
||||||
"nodejs_package_manager_path": "npm",
|
"nodejs_package_manager_path": "npm",
|
||||||
"vue.rearranger.settings.migration": "true"
|
"vue.rearranger.settings.migration": "true"
|
||||||
}
|
}
|
||||||
}]]></component>
|
}</component>
|
||||||
<component name="RunManager" selected="Gradle.NginxInstallerBackend [shadowJar]">
|
<component name="RunManager" selected="Gradle.NginxInstallerBackend [shadowJar]">
|
||||||
<configuration name="Server" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
|
<configuration name="Server" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
|
||||||
<option name="MAIN_CLASS_NAME" value="tech.nevets.ngxinstaller.Server" />
|
<option name="MAIN_CLASS_NAME" value="tech.nevets.ngxinstaller.Server" />
|
||||||
@ -148,7 +147,9 @@
|
|||||||
<option name="number" value="Default" />
|
<option name="number" value="Default" />
|
||||||
<option name="presentableId" value="Default" />
|
<option name="presentableId" value="Default" />
|
||||||
<updated>1703015833777</updated>
|
<updated>1703015833777</updated>
|
||||||
<workItem from="1703015834937" duration="10569000" />
|
<workItem from="1703015834937" duration="11923000" />
|
||||||
|
<workItem from="1703098848808" duration="606000" />
|
||||||
|
<workItem from="1704314407897" duration="15000" />
|
||||||
</task>
|
</task>
|
||||||
<servers />
|
<servers />
|
||||||
</component>
|
</component>
|
||||||
|
@ -4,7 +4,7 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group = 'tech.nevets'
|
group = 'tech.nevets'
|
||||||
version = '0.1.0'
|
version = '0.1.1'
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
@ -14,7 +14,12 @@ import static spark.Spark.*;
|
|||||||
public class Server {
|
public class Server {
|
||||||
private static final Gson GSON = new GsonBuilder().setPrettyPrinting().create();
|
private static final Gson GSON = new GsonBuilder().setPrettyPrinting().create();
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
port(8080);
|
if (args.length >= 1) {
|
||||||
|
port(Integer.parseInt(args[0]));
|
||||||
|
} else {
|
||||||
|
port(8080);
|
||||||
|
}
|
||||||
|
|
||||||
post("/ngx/create", (req, res) -> {
|
post("/ngx/create", (req, res) -> {
|
||||||
JsonObject jsonObject = GSON.fromJson(req.body(), JsonObject.class);
|
JsonObject jsonObject = GSON.fromJson(req.body(), JsonObject.class);
|
||||||
TextStorage ts = TextStorage.createPaste(jsonObject.get("content").getAsString());
|
TextStorage ts = TextStorage.createPaste(jsonObject.get("content").getAsString());
|
||||||
|
Loading…
Reference in New Issue
Block a user