INNER CODE UNIT · Swift
startServer
gcollazo/mongodbapp · MongoDB/AppDelegate.swift:65
func startServer() {
self.task = Process()
self.pipe = Pipe()
self.file = self.pipe.fileHandleForReading
if let path = Bundle.main.path(forResource: "mongod", ofType: "", inDirectory: "Vendor/mongodb/bin") {
self.task.launchPath = path
}
self.task.arguments = [
"--dbpath", "\(self.dataPath)",
"--nounixsocket",
"--bind_ip",
"127.0.0.1",
"--logpath", "\(self.logPath)/mongo.log"
]
self.task.standardOutput = self.pipe