Git Product home page Git Product logo

spring-boot-static-web's Introduction

Static Content Webserver with Spring Boot

This is a bare-bones scaffold with the single purpose of serving static content using a Spring Boot application with an embedded Tomcat inside.

It produces a single fat executable jar, with all dependencies and the content in it.

Just drop your site content in the webroot, build the jar and then run it!

How to build and run

$ ./buildAndRun.sh

The server listens on localhost:8080.

It doesn't work, do I need to install something first?

Yes, you need

Where is the webroot?

src/main/resouces/public

How can I configure port, logging, etc?

This is called "externalized configuration" in Spring Boot, basically add an application.properties file, set environment variables, or use a combination of both.

To change port number, add a file src/main/resources/application.properties and put server.port=8090 in it for example.

For full documentation see

69.1 Externalize the configuration of SpringApplication

How can I add SSL, proxy config, or change Tomcat to Jetty or Undertow?

See 70. Embedded servlet containers

Where can I read more about the settings?

Spring Boot Docs / 27.1.4 Static Content

Can I also use a template engine, such as Mustasche?

Yes you can

spring-boot-static-web's People

Contributors

aweijnitz avatar

Watchers

 avatar James Cloos avatar  avatar

Forkers

kunjalr

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.