-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Giovanni Olivera
committed
Jan 16, 2018
1 parent
1d62827
commit c1789b5
Showing
8 changed files
with
348 additions
and
15 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
require("babel-register") | ||
require("./src/app.js") | ||
const App = require("./src/app.js") | ||
|
||
App.run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import Server from "~/Server" | ||
import config from "config" | ||
import maxmind from "maxmind" | ||
import path from "path" | ||
|
||
const App = { | ||
run() { | ||
maxmind.open(path.join(__dirname, "/geoip/GeoLite2-City.mmdb"), (err, iplookup) => { | ||
if(err) throw err; | ||
const server = new Server(config.get("listen")) | ||
server.start() | ||
}); | ||
} | ||
}.freeze; | ||
|
||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import Mongoose from "mongoose" | ||
Mongoose.Promise = global.Promise | ||
|
||
const Mongo = { | ||
connect(conn_str) { | ||
const mongo = Mongoose.connect( | ||
conn_str, | ||
{ | ||
useMongoClient: true | ||
}, | ||
err => { | ||
if (err) { | ||
console.error("Could not connect to MongoDB on port 27017") | ||
} | ||
} | ||
) | ||
|
||
return mongo | ||
} | ||
}.freeze() | ||
|
||
export default Mongo |
Oops, something went wrong.