Skip to content

Commit 965d429

Browse files
committed
cleanup
1 parent 163f50e commit 965d429

2 files changed

Lines changed: 4 additions & 23 deletions

File tree

server/src/main/java/dev/harrel/App.java

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,20 @@
77
public class App {
88

99
static void main() {
10-
StaticContent webRoot =
11-
StaticContent.ofClassPath("/web/index.html")
12-
.route("/*")
10+
StaticContent robots =
11+
StaticContent.ofClassPath("/robots/robots.txt")
12+
.route("/robots.txt")
1313
.build();
1414
StaticContent webBundle =
1515
StaticContent.ofClassPath("/web")
1616
.route("/*")
17-
.directoryIndex("files.index")
18-
.preCompress()
17+
.directoryIndex("index.html")
1918
.putResponseHeader("Cache-Control", "max-age=86400")
2019
.build();
21-
StaticContent robots =
22-
StaticContent.ofClassPath("/robots/robots.txt")
23-
.route("/robots.txt")
24-
.putMimeTypeMapping("txt", "application/javascript")
25-
.build();
2620

2721
Jex.create()
2822
.plugin(robots)
2923
.plugin(webBundle)
30-
.plugin(webRoot)
3124
.jsonService(new Jackson3JsonService())
3225
.get("/api/version", new VersionHandler())
3326
.post("/api/json-validate", new ValidationHandler())

web/build.gradle

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,6 @@ tasks.register('build', Exec) {
1717
exclude 'dist', 'node_modules', 'bun.lockb'
1818
}.findAll())
1919
outputs.dir('dist')
20-
21-
// create index file
22-
doLast {
23-
def fileNames = []
24-
def distPath = file('dist').toPath()
25-
fileTree('dist').each {
26-
fileNames.add distPath.relativize(it.toPath())
27-
}
28-
print fileNames
29-
def indexFile = distPath.resolve('files.index').toFile()
30-
indexFile.text = fileNames.join(System.lineSeparator())
31-
}
3220
}
3321

3422
artifacts {

0 commit comments

Comments
 (0)