Skip to content

Commit 81cda29

Browse files
committed
Servidor
1 parent 61187b2 commit 81cda29

File tree

7 files changed

+17
-15
lines changed

7 files changed

+17
-15
lines changed

.env

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
MYSQL_ROOT_PASSWORD=12345678
21
MYSQL_DATABASE=proyecto_aula
32
MYSQL_USER=user
4-
MYSQL_PASSWORD=12345678
3+
MYSQL_PASSWORD=123456789

.gitignore

+1-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
.bsp/
55
.scala-build/
66

7-
src/main/resources/
87
# Ignorar archivos generados por SBT
98
target/
109

@@ -28,5 +27,4 @@ target/
2827

2928
# Ignorar archivos de construcción y configuración personal
3029
build.sbt.local
31-
*.sbt.local
32-
.scalafmt.conf
30+
*.sbt.local

.scalafmt.conf

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
version = "2.7.5"
2+
3+
maxColumn = 120
4+
project.git = true

docker-compose.yml

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ services:
66
image: mariadb
77
command: --init-file /docker-entrypoint-initdb.d/init.sql
88
environment:
9-
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
109
MYSQL_DATABASE: ${MYSQL_DATABASE}
1110
MYSQL_USER: ${MYSQL_USER}
1211
MYSQL_PASSWORD: ${MYSQL_PASSWORD}

src/main/resources/application.conf

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
db {
2+
user = "user"
3+
password = "123456789"
4+
urlMaestro = "jdbc:mariadb://207.248.81.126:3306/proyecto_aula"
5+
}

src/main/scala/example/DatabaseConfig.scala

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ object DatabaseConfig {
1010

1111
val config = ConfigFactory.load()
1212
val dbMasterUrl = config.getString("db.urlMaestro")
13-
val dbSlaveUrl = config.getString("db.urlEsclavo")
1413
val dbUser = config.getString("db.user")
1514
val dbPassword = config.getString("db.password")
1615

src/main/scala/example/main.scala

+6-8
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,10 @@ object Main extends App {
3131

3232
val routes: Route = userRoute.route ~ fileRoute.route ~ directoryRoute.route
3333

34-
val bindingFuture = Http().bindAndHandle(routes, "localhost", 8080)
35-
println(s"Server online at http://localhost:8080/")
36-
37-
// Mantén el programa en ejecución
38-
scala.io.StdIn.readLine()
39-
bindingFuture
40-
.flatMap(_.unbind())
41-
.onComplete(_ => system.terminate())
34+
val bindingFuture = Http().bindAndHandle(routes, "0.0.0.0", 8080)
35+
println(s"Server online at http://207.248.81.126:8080/")
36+
37+
while (true) {
38+
Thread.sleep(10000)
39+
}
4240
}

0 commit comments

Comments
 (0)