File tree Expand file tree Collapse file tree
server/src/main/java/dev/harrel Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77public 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 ())
Original file line number Diff line number Diff 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
3422artifacts {
You can’t perform that action at this time.
0 commit comments