Skip to content

Commit 2f9c101

Browse files
committed
better welcome message
1 parent 75462bd commit 2f9c101

File tree

4 files changed

+15
-17
lines changed

4 files changed

+15
-17
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
- New `article` property in the text component to display text in a more readable, article-like format.
3636
- Add support for evaluating calls to `coalesce` inside sqlpage functions. This means you can now use `coalesce` inside arguments of sqlpage functions, and it will be evaluated inside sqlpage. For instance, this lets you call `sqlpage.link(coalesce($url, 'https://sql-page.com'))` to create a link that will use the value of `$url` if it is not null, or fallback to `https://sql-page.com` if it is null.
3737
- In the form component, allow the usage of the `value` property in checkboxes and radio buttons. The custom `checked` property still works, but it is now optional.
38+
- Updated the welcome message displayed on the terminal when starting the server to be friendlier and more helpful.
3839

3940
## 0.31.0 (2024-11-24)
4041

src/webserver/database/connect.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ impl Database {
3131
database_url
3232
);
3333
set_custom_connect_options(&mut connect_options, config);
34-
log::info!("Connecting to database: {database_url}");
34+
log::debug!("Connecting to database: {database_url}");
3535
let mut retries = config.database_connection_retries;
3636
let connection = loop {
3737
match Self::create_pool_options(config, connect_options.kind())

src/webserver/database/migrations.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pub async fn apply(config: &crate::app_config::AppConfig, db: &Database) -> anyh
2121
.await
2222
.with_context(|| migration_err("preparing the database migration"))?;
2323
if migrator.migrations.is_empty() {
24-
log::info!("No migration found in {}. \
24+
log::debug!("No migration found in {}. \
2525
You can specify database operations to apply when the server first starts by creating files \
2626
in {MIGRATIONS_DIR}/<VERSION>_<DESCRIPTION>.sql \
2727
where <VERSION> is a number and <DESCRIPTION> is a short string.", migrations_dir.display());

src/webserver/http.rs

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -662,25 +662,22 @@ fn log_welcome_message(config: &AppConfig) {
662662
} else if let Some(domain) = &config.https_domain {
663663
format!("https://{domain}")
664664
} else {
665-
use std::fmt::Write;
666665
let listen_on = config.listen_on();
667-
let mut msg = format!("{listen_on}");
668-
if listen_on.ip().is_unspecified() {
669-
// let the user know the service is publicly accessible
670-
write!(
671-
msg,
672-
": accessible from the network, and locally on http://localhost:{}",
673-
listen_on.port()
674-
)
675-
.unwrap();
666+
let port = listen_on.port();
667+
let ip = listen_on.ip();
668+
if ip.is_unspecified() {
669+
format!("http://localhost:{port}\n\
670+
(also accessible from other devices using your IP address)")
671+
} else {
672+
format!("http://{ip}:{port}")
676673
}
677-
msg
678674
};
679675

680-
log::info!(
681-
"SQLPage v{} started successfully.
682-
Now listening on {}
683-
You can write your website's code in .sql files in {}",
676+
println!(
677+
"✨ SQLPage v{} is ready! ✨\n\n\
678+
View your website at:\n🔗 {}\n\n\
679+
Create your pages using SQL files in:\n💻 {}\n\n\
680+
Happy coding! 🚀",
684681
env!("CARGO_PKG_VERSION"),
685682
address_message,
686683
config.web_root.display()

0 commit comments

Comments
 (0)