Scala Native Nginx Unit server and client built on an Apple M1 using Sttp and Scala 3.
This project is currently broken until com.github.lolgab" %%% "snunit supports Scala Native 0.5.1.
See http://www.scala-native.org/en/latest/user/setup.html for details.
- brew install llvm
- brew install bdw-gc
- brew install nginx/unit/unit
- start: nohup unitd --no-daemon --log /dev/stdout --control unix:control.sock &
- verify: ps ax | grep unitd
- stop: Ctrl-C
- sbt clean compile nativeLink
Multiple main classes detected. Select one to run:
[1] objektwerks.NowClient
[2] objektwerks.NowServer
Enter number: 2
- mv target/scala-3.3.1/scala-native-nginx-out target/scala-3.3.1/now-server
- sudo cp target/scala-3.3.1/now-server /usr/local/bin
- nohup unitd --no-daemon --log /dev/stdout --control unix:control.sock & (start nginx unit, if stopped)
- ./deploy.sh ( chmod 755 deploy.sh )
See config.json for Nginx Unit and NowServer config.
- sbt clean compile nativeLink
Multiple main classes detected. Select one to run:
[1] objektwerks.NowClient
[2] objektwerks.NowServer
Enter number: 1
- mv target/scala-3.3.1/scala-native-nginx-out target/scala-3.3.1/now-client
- sudo cp target/scala-3.3.1/now-client /usr/local/bin
- nohup unitd --no-daemon --log /dev/stdout --control unix:control.sock & (start nginx unit, if stopped)
- now-client [ url ] ( the default NowServer url is detailed in config.json )
- nohup unitd --no-daemon --log /dev/stdout --control unix:control.sock & (start nginx unit, if stopped)
- curl http://localhost:7474/
- kill -9 pid ( rm control.sock nohup.out )