forked from maiora/backend-api
		
	Compare commits
	
		
			2 Commits
		
	
	
		
			8e456610f3
			...
			5da7cfcfc2
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 5da7cfcfc2 | |||
| 8a934dca5b | 
@ -28,7 +28,7 @@ fun Application.module(configFile: Properties) {
 | 
				
			|||||||
    val secret = config.property("ktor.jwt.secret").getString()
 | 
					    val secret = config.property("ktor.jwt.secret").getString()
 | 
				
			||||||
    configureDatabases(dbUrl, username, password)
 | 
					    configureDatabases(dbUrl, username, password)
 | 
				
			||||||
    configureSecurity(secret)
 | 
					    configureSecurity(secret)
 | 
				
			||||||
    configureRouting(dbUrl, username, password)
 | 
					    configureRouting()
 | 
				
			||||||
    configureSerialization()
 | 
					    configureSerialization()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    install(CallLogging)
 | 
					    install(CallLogging)
 | 
				
			||||||
 | 
				
			|||||||
@ -7,7 +7,7 @@ import io.ktor.server.application.*
 | 
				
			|||||||
import io.ktor.server.response.*
 | 
					import io.ktor.server.response.*
 | 
				
			||||||
import io.ktor.server.routing.*
 | 
					import io.ktor.server.routing.*
 | 
				
			||||||
 | 
					
 | 
				
			||||||
fun Application.configureRouting(dbUrl : String, username : String, password : String) {
 | 
					fun Application.configureRouting() {
 | 
				
			||||||
    routing {
 | 
					    routing {
 | 
				
			||||||
        get("/") {
 | 
					        get("/") {
 | 
				
			||||||
            call.respondText("Hello World!")
 | 
					            call.respondText("Hello World!")
 | 
				
			||||||
 | 
				
			|||||||
@ -16,7 +16,7 @@ import java.util.*
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
fun Route.auth(accountsRepository: AccountsRepositoryImpl) {
 | 
					fun Route.auth(accountsRepository: AccountsRepositoryImpl) {
 | 
				
			||||||
    route("/auth") {
 | 
					    route("/api/auth") {
 | 
				
			||||||
        post() {
 | 
					        post() {
 | 
				
			||||||
            // Riceve il body della richiesta e lo deserializza in ReceivedResponse
 | 
					            // Riceve il body della richiesta e lo deserializza in ReceivedResponse
 | 
				
			||||||
            val receivedResponse = try {
 | 
					            val receivedResponse = try {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user