<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Tobias</title>
    <description>The latest articles on DEV Community by Tobias (@dydent).</description>
    <link>https://dev.to/dydent</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2483217%2F7d57cd2c-ded1-4fe6-a9c5-8ff432407af7.png</url>
      <title>DEV Community: Tobias</title>
      <link>https://dev.to/dydent</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dydent"/>
    <language>en</language>
    <item>
      <title>From TypeScript to Spring Boot: a small developer convenience I missed</title>
      <dc:creator>Tobias</dc:creator>
      <pubDate>Fri, 04 Sep 2026 16:10:31 +0000</pubDate>
      <link>https://dev.to/dydent/from-typescript-to-spring-boot-a-small-developer-convenience-i-missed-96h</link>
      <guid>https://dev.to/dydent/from-typescript-to-spring-boot-a-small-developer-convenience-i-missed-96h</guid>
      <description>&lt;p&gt;Coming from TypeScript, Node.js, and Express, I was used to having useful local URLs printed in the terminal when an application started.&lt;/p&gt;

&lt;p&gt;Start the server. Click the link. Open the API documentation.&lt;/p&gt;

&lt;p&gt;When working with Spring Boot, I missed that small convenience. So I built a tiny open-source starter that prints the configured Swagger UI URL after application startup—just add the dependency and enable it in configuration.&lt;/p&gt;

&lt;p&gt;I know what you might be thinking: &lt;strong&gt;Spring Boot doesn’t need a library to print a URL!&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The one-line solution is perfectly valid
&lt;/h2&gt;

&lt;p&gt;In a Spring Boot application, this is enough:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="nc"&gt;SpringApplication&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;MyApplication&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;class&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
    &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;
        &lt;span class="s"&gt;"Swagger UI: http://localhost:8080/swagger-ui.html"&lt;/span&gt;
    &lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If your application always uses that port and path, this is a reasonable solution. You probably don’t need another dependency.&lt;/p&gt;

&lt;p&gt;The same distinction applies to Express. Express itself doesn’t automatically print a Swagger UI link. Its &lt;a href="https://github.com/expressjs/express#readme" rel="noopener noreferrer"&gt;official example&lt;/a&gt; explicitly adds a console message inside the &lt;code&gt;app.listen()&lt;/code&gt; callback.&lt;/p&gt;

&lt;p&gt;My inspiration was the workflow I associated with my Node projects—not a built-in feature that Java was missing.&lt;/p&gt;

&lt;p&gt;That leaves a fair question: why build a library?&lt;/p&gt;

&lt;h2&gt;
  
  
  The URL is the part that changes
&lt;/h2&gt;

&lt;p&gt;A hardcoded message is simple because it assumes the address is already known.&lt;/p&gt;

&lt;p&gt;That assumption gets less convenient when applications have different configurations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;One uses a different server port.&lt;/li&gt;
&lt;li&gt;Another runs beneath an application context path.&lt;/li&gt;
&lt;li&gt;Swagger UI has a custom path.&lt;/li&gt;
&lt;li&gt;A local instance uses a randomly assigned port.&lt;/li&gt;
&lt;li&gt;Documentation is exposed on a separate management port.&lt;/li&gt;
&lt;li&gt;Local access uses HTTPS.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can handle these cases in application code. But then you’re maintaining URL-building logic rather than a single print statement.&lt;/p&gt;

&lt;p&gt;The starter packages that behavior so it can be reused across services.&lt;/p&gt;

&lt;p&gt;Its purpose is deliberately narrow:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A tiny, opt-in Spring Boot starter that prints your configured Swagger UI URL—without maintaining URL-building startup code across services.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Here’s the output from an application where I tried it:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fdaym4xlbmg4s7x3tpaqc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fdaym4xlbmg4s7x3tpaqc.png" alt="Spring Boot startup console showing the Swagger UI URL at localhost:8083/api/importer/swagger-ui" width="789" height="28"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The starter prints the configured Swagger UI URL immediately after application startup, including the custom port and context path.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Using it
&lt;/h2&gt;

&lt;p&gt;If your application already serves Swagger UI, add this dependency:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;dependency&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;groupId&amp;gt;&lt;/span&gt;io.github.dydent&lt;span class="nt"&gt;&amp;lt;/groupId&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;artifactId&amp;gt;&lt;/span&gt;swagger-ui-link-spring-boot-starter&lt;span class="nt"&gt;&amp;lt;/artifactId&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;version&amp;gt;&lt;/span&gt;0.1.0&lt;span class="nt"&gt;&amp;lt;/version&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/dependency&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then enable it in your local configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="c1"&gt;# application-local.yml&lt;/span&gt;
&lt;span class="na"&gt;swagger-ui-link&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;enabled&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run your application with the &lt;code&gt;local&lt;/code&gt; Spring profile active.&lt;/p&gt;

&lt;p&gt;For an application using the default port and springdoc UI path, the output looks like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Swagger UI: http://localhost:8080/swagger-ui.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Most terminals and IDE consoles make that URL clickable.&lt;/p&gt;

&lt;p&gt;The dependency does not install Swagger UI. It reports the address of the UI your application already serves.&lt;/p&gt;

&lt;h2&gt;
  
  
  Local convenience, explicitly enabled
&lt;/h2&gt;

&lt;p&gt;I only want this message during local development.&lt;/p&gt;

&lt;p&gt;The starter is disabled by default, so I enable it in &lt;code&gt;application-local.yml&lt;/code&gt;. Production stays quiet as long as that profile isn’t active and the setting isn’t enabled elsewhere.&lt;/p&gt;

&lt;p&gt;This uses Spring Boot’s existing profile mechanism. It isn’t a separate environment-detection system.&lt;/p&gt;

&lt;p&gt;You can achieve the same result yourself. In Express, you could guard a startup message:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;listen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;NODE_ENV&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;development&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Swagger UI: http://localhost:3000/api-docs&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In Spring Boot, you can check the profile after startup. Assuming an existing SLF4J logger named &lt;code&gt;log&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;SpringApplication&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;MyApplication&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;class&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getEnvironment&lt;/span&gt;&lt;span class="o"&gt;().&lt;/span&gt;&lt;span class="na"&gt;matchesProfiles&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"local"&lt;/span&gt;&lt;span class="o"&gt;))&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;log&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;info&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Swagger UI: http://localhost:8080/swagger-ui.html"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Both are valid solutions. The starter simply packages the opt-in behavior alongside URL resolution, so application code doesn’t need to handle either concern.&lt;/p&gt;

&lt;p&gt;Importantly, disabling the message does &lt;strong&gt;not&lt;/strong&gt; disable or secure Swagger UI. That remains the application’s responsibility.&lt;/p&gt;

&lt;h2&gt;
  
  
  A small library with a small job
&lt;/h2&gt;

&lt;p&gt;This isn’t rocket science, and it’s not trying to be. In my opinion, it’s just a nice little developer-experience improvement: start the application, click the link, and get on with your work.&lt;/p&gt;

&lt;p&gt;For one application with a fixed URL, a simple log statement may be enough. For multiple services with different configurations, the starter saves you from maintaining that startup logic yourself.&lt;/p&gt;

&lt;p&gt;Version &lt;code&gt;0.1.0&lt;/code&gt; is available on Maven Central under the Apache-2.0 license. You can find the source and setup instructions on &lt;a href="https://github.com/dydent/swagger-ui-link-spring-boot" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Now I’m curious: how do you handle this in your Spring Boot projects today—a startup log, an IDE shortcut, a bookmark, or something else? Would a tiny starter like this be useful to you, or would you stick with a few lines of application code? I’d love to hear your approach and what you think in the comments.&lt;/p&gt;

</description>
      <category>java</category>
      <category>springboot</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
