Skip to content

Commit 019a630

Browse files
authored
Create readme.md
1 parent d5a0288 commit 019a630

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

setting-context-path/readme.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Add Context Path to a Spring Boot Application
2+
3+
In a Spring Boot application, the context path represents the base URL for accessing your application. By default, it's set to '/',
4+
5+
To change the context path, you need to add the following property to your application.properties file.
6+
7+
```
8+
server.servlet.context-path=/api/1.0
9+
```
10+
11+
Alternatively, if you're using the application.yaml file, you can do this
12+
13+
```
14+
server:
15+
servlet:
16+
context-path: '/api/1.0'
17+
18+
```
19+
20+
Read [full article here](https://stacktips.com/articles/add-context-path-to-a-spring-boot-application)
21+
22+
### Related topics:
23+
24+
* [#spring-boot](https://stacktips.com/topics/spring-boot)
25+
* [#android](https://stacktips.com/topics/android)
26+
* [#java](https://stacktips.com/topics/java)
27+
* [#python](https://stacktips.com/topics/python)
28+
* [#spring](https://stacktips.com/topics/spring)
29+
* [#design-pattern](https://stacktips.com/topics/design-pattern)
30+
* [#git](https://stacktips.com/topics/git)
31+
* [#maven](https://stacktips.com/topics/maven)

0 commit comments

Comments
 (0)