blogatto/dev
Development server tool for Blogatto.
Types
A development server for Blogatto. This will serve the generated blog and watch for file changes to trigger rebuilds.
pub type DevServer(msg) {
DevServer(
build_command: String,
config: config.Config(msg),
port: Int,
host: String,
live_reload: Bool,
)
}
Constructors
-
DevServer( build_command: String, config: config.Config(msg), port: Int, host: String, live_reload: Bool, )Arguments
- build_command
-
Build command to build the blog. (default: “gleam run”)
- config
-
Blogatto build config to use for knowing which files to watch.
- port
-
port to listen on. (default: 3000)
- host
-
Host to listen on. (default: “127.0.0.1”)
- live_reload
-
Inject the live reload script into the generated HTML pages. (default: true)
Values
pub fn build_command(
server: DevServer(msg),
build_command: String,
) -> DevServer(msg)
Set the build command to use for building the blog. This should be a command that can be run in the terminal to build the blog, such as “gleam run” or “make build”.
pub fn live_reload(
server: DevServer(msg),
live_reload: Bool,
) -> DevServer(msg)
Set whether to inject the live reload script into the generated HTML pages.
pub fn new(config: config.Config(msg)) -> DevServer(msg)
Create a new development server with the given config and options.
pub fn start(
server: DevServer(msg),
) -> Result(Nil, error.BlogattoError)
Start the development server. This will block the current thread until the server is stopped.