-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cleaned code minor bug fixes version release 1.1.0
- Loading branch information
1 parent
c3d03e0
commit b3fa2b9
Showing
7 changed files
with
63 additions
and
58 deletions.
There are no files selected for viewing
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,10 +1,7 @@ | ||
SMTP_FROM_EMAIL="[email protected]" | ||
SMTP_TO_EMAIL="[email protected]" | ||
SMTP_TO_PASSWORD="***************" | ||
|
||
SMTP_DEV_FROM="[email protected]" | ||
SMTP_DEV_EMAIL="[email protected]" | ||
SMTP_TO_PASSWORD="****************" | ||
|
||
SMTP_DEV_FROM="[email protected]" | ||
SMTP_DEV_EMAIL="[email protected]" | ||
SMTP_DEV_PASSWORD="***************" | ||
|
||
STARTTLS=true | ||
SMTP_DEV_PASSWORD="****************" |
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
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
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,51 +1,51 @@ | ||
const express = require('express') | ||
const cluster = require('cluster') | ||
const numCPUs = require('os').cpus().length | ||
const express = require("express"); | ||
const cluster = require("cluster"); | ||
const numCPUs = require("os").cpus().length; | ||
|
||
const isDev = process.env.NODE_ENV !== 'production' | ||
const isDev = process.env.NODE_ENV !== "production"; | ||
|
||
// Multi-process to utilize all CPU cores. | ||
if (!isDev && cluster.isMaster) { | ||
console.error(`Node cluster master ${process.pid} is running`) | ||
|
||
// Fork workers. | ||
for (let i = 0; i < numCPUs; i++) { | ||
cluster.fork() | ||
} | ||
|
||
cluster.on('exit', (worker, code, signal) => { | ||
console.error( | ||
`Node cluster worker ${worker.process.pid} exited: code ${code}, signal ${signal}` | ||
) | ||
}) | ||
console.error(`Node cluster master ${process.pid} is running`); | ||
|
||
// Fork workers. | ||
for (let i = 0; i < numCPUs; i++) { | ||
cluster.fork(); | ||
} | ||
|
||
cluster.on("exit", (worker, code, signal) => { | ||
console.error( | ||
`Node cluster worker ${worker.process.pid} exited: code ${code}, signal ${signal}` | ||
); | ||
}); | ||
} else { | ||
const app = express() | ||
const morgan = require('morgan') | ||
const path = require('path') | ||
const app = express(); | ||
const morgan = require("morgan"); | ||
const path = require("path"); | ||
|
||
const PORT = process.env.PORT || 5000 | ||
const PORT = process.env.PORT || 5000; | ||
|
||
// Priority serve any static files. | ||
// Replace the example to connect to your frontend. | ||
app.use(express.static(path.join(__dirname, '/example/frontend.js'))) | ||
// Priority serve any static files. | ||
// Replace the example to connect to your frontend. | ||
app.use(express.static(path.join(__dirname, "/example/frontend.js"))); | ||
|
||
// dev middleware | ||
app.use(morgan('dev')) | ||
// dev middleware | ||
app.use(morgan("dev")); | ||
|
||
// configure body parser for AJAX requests | ||
app.use(express.urlencoded({ extended: false })) | ||
app.use(express.json()) | ||
// configure body parser for AJAX requests | ||
app.use(express.urlencoded({ extended: false })); | ||
app.use(express.json()); | ||
|
||
const routes = require('./routes/routes') | ||
const routes = require("./routes/routes"); | ||
|
||
// after all middleware functions | ||
app.use('/', routes) | ||
// after all middleware functions | ||
app.use("/", routes); | ||
|
||
app.listen(PORT, function () { | ||
console.error( | ||
`Node ${ | ||
isDev ? 'dev server' : 'cluster worker ' + process.pid | ||
}: listening on port ${PORT}` | ||
) | ||
}) | ||
app.listen(PORT, function () { | ||
console.error( | ||
`Node ${ | ||
isDev ? "dev server" : "cluster worker " + process.pid | ||
}: listening on port ${PORT}` | ||
); | ||
}); | ||
} |