source: bus-n-go-pavel-216049/bus-n-go-backend/src/main/kotlin/mk/ukim/finki/busngobackend/BusNGoBackendApplication.kt

Last change on this file was baf4cc4, checked in by ppaunovski <paunovskipavel@…>, 3 months ago

split group project and individual project into two separate folders

  • Property mode set to 100644
File size: 1.4 KB
Line 
1package mk.ukim.finki.busngobackend
2
3import org.springframework.boot.autoconfigure.SpringBootApplication
4import org.springframework.boot.runApplication
5import org.springframework.context.annotation.Bean
6import org.springframework.context.event.ApplicationEventMulticaster
7import org.springframework.context.event.SimpleApplicationEventMulticaster
8import org.springframework.core.task.SimpleAsyncTaskExecutor
9import org.springframework.scheduling.annotation.EnableAsync
10import org.springframework.scheduling.annotation.EnableScheduling
11import org.springframework.security.crypto.password.NoOpPasswordEncoder
12import org.springframework.security.crypto.password.PasswordEncoder
13
14@SpringBootApplication
15@EnableAsync
16@EnableScheduling
17class BusNGoBackendApplication
18
19fun main(args: Array<String>) {
20 runApplication<BusNGoBackendApplication>(*args)
21}
22
23@Bean
24fun encoder(): PasswordEncoder = NoOpPasswordEncoder.getInstance()
25// object : PasswordEncoder {
26// override fun encode(rawPassword: CharSequence?): String = rawPassword.toString()
27//
28// override fun matches(
29// rawPassword: CharSequence?,
30// encodedPassword: String?,
31// ): Boolean = rawPassword != null && rawPassword.toString() == encodedPassword
32// }
33
34@Bean
35fun asyncEventPublisher(): ApplicationEventMulticaster {
36 val publisher = SimpleApplicationEventMulticaster()
37 publisher.setTaskExecutor(SimpleAsyncTaskExecutor())
38 return publisher
39}
Note: See TracBrowser for help on using the repository browser.