Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
LaMartin-Webomagic
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Arnab Sen
LaMartin-Webomagic
Commits
a0785ca0
Commit
a0785ca0
authored
Jun 30, 2024
by
Deep Dey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: update web configuration
parent
8bec9265
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
10 deletions
+28
-10
lamartinBackend/src/main/java/com/example/LaMartin/config/Settings.java
...d/src/main/java/com/example/LaMartin/config/Settings.java
+13
-0
lamartinBackend/src/main/java/com/example/LaMartin/config/WebMvcConfig.java
...c/main/java/com/example/LaMartin/config/WebMvcConfig.java
+7
-6
lamartinBackend/src/main/resources/application-dev.properties
...rtinBackend/src/main/resources/application-dev.properties
+2
-1
lamartinBackend/src/main/resources/application-prod.properties
...tinBackend/src/main/resources/application-prod.properties
+6
-3
No files found.
lamartinBackend/src/main/java/com/example/LaMartin/config/Settings.java
0 → 100644
View file @
a0785ca0
package
com
.
example
.
LaMartin
.
config
;
import
lombok.Getter
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
@Service
@Getter
public
class
Settings
{
@Value
(
"${lamartin.static.resources.root.path}"
)
// Read path from application.properties
private
String
staticResourcesRootPath
;
}
lamartinBackend/src/main/java/com/example/LaMartin/config/WebMvcConfig.java
View file @
a0785ca0
package
com
.
example
.
LaMartin
.
config
;
import
lombok.AllArgsConstructor
;
import
org.jetbrains.annotations.NotNull
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.context.annotation.Configuration
;
...
...
@@ -14,17 +16,16 @@ import java.util.Locale;
@Configuration
@ComponentScan
(
basePackages
=
{
"com.example.LaMartin"
})
@AllArgsConstructor
(
onConstructor_
=
@__
({
@Autowired
}))
public
class
WebMvcConfig
implements
WebMvcConfigurer
{
private
final
Settings
settings
;
@Override
public
void
addResourceHandlers
(
@NotNull
ResourceHandlerRegistry
registry
)
{
registry
.
addResourceHandler
(
"/resources/static/**"
)
.
addResourceLocations
(
"/"
);
registry
.
addResourceHandler
(
"/static/**"
)
.
addResourceLocations
(
"/"
);
.
addResourceHandler
(
"/resources/**"
)
.
addResourceLocations
(
"file:"
+
settings
.
getStaticResourcesRootPath
()
+
"/"
);
}
@Override
...
...
lamartinBackend/src/main/resources/application-dev.properties
View file @
a0785ca0
...
...
@@ -7,4 +7,5 @@ spring.web.resources.cache.cachecontrol.s-max-age=3600000
spring.datasource.username
=
postgres
spring.datasource.password
=
2580
spring.redis.host
=
localhost
spring.redis.port
=
6379
\ No newline at end of file
spring.redis.port
=
6379
lamartin.static.resources.root.path
=
D:/WEBSOFTTECHS/webomagic/data
\ No newline at end of file
lamartinBackend/src/main/resources/application-prod.properties
View file @
a0785ca0
spring.thymeleaf.cache
=
true
logging.level.web
=
DEBUG
#server.error.include-binding-errors=never
#server.error.include-message=always
server.http2.enabled
=
true
spring.datasource.url
=
jdbc:postgresql://localhost:5432/
webomagic
spring.datasource.url
=
jdbc:postgresql://localhost:5432/
lamartin
spring.web.resources.cache.cachecontrol.s-max-age
=
3600000
spring.datasource.username
=
postgres
spring.datasource.password
=
2580
spring.redis.host
=
localhost
spring.redis.port
=
6379
\ No newline at end of file
spring.redis.port
=
6379
lamartin.static.resources.root.path
=
D:/WEBSOFTTECHS/webomagic/data
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment