Skip to content

Commit

Permalink
(fix) prod script
Browse files Browse the repository at this point in the history
  • Loading branch information
NemesisX1 committed Oct 17, 2023
1 parent 096e5da commit ea9c35d
Show file tree
Hide file tree
Showing 24 changed files with 12,581 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,6 @@ typings/
# next.js build output
.next

src/docs/swagger-output.json
src/docs/swagger-output.json

dist
77 changes: 77 additions & 0 deletions dist/bin/www.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
"use strict";
/**
* Module dependencies.
*/
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
require("module-alias/register");
const dotenv_1 = require("dotenv");
(0, dotenv_1.config)();
const app_1 = __importDefault(require("@/app"));
const debug_1 = __importDefault(require("debug"));
const http_1 = __importDefault(require("http"));
const debug = (0, debug_1.default)('canal-olympia:server');
const loggers_1 = require("@/utils/loggers");
(0, loggers_1.bootstrapLogger)();
/**
* Get port from environment and store in Express.
*/
const port = normalizePort(process.env.PORT || '3100');
app_1.default.set('port', port);
/**
* Create HTTP server.
*/
const server = http_1.default.createServer(app_1.default);
/**
* Listen on provided port, on all network interfaces.
*/
server.listen(port, () => console.log('🚀 ~ server launch ~ port', port));
server.on('error', onError);
server.on('listening', onListening);
/**
* Normalize a port into a number, string, or false.
*/
function normalizePort(val) {
var port = parseInt(val, 10);
if (isNaN(port)) {
// named pipe
return val;
}
if (port >= 0) {
// port number
return port;
}
return false;
}
/**
* Event listener for HTTP server "error" event.
*/
function onError(error) {
if (error.syscall !== 'listen') {
throw error;
}
var bind = typeof port === 'string' ? 'Pipe ' + port : 'Port ' + port;
// handle specific listen errors with friendly messages
switch (error.code) {
case 'EACCES':
console.error(bind + ' requires elevated privileges');
process.exit(1);
break;
case 'EADDRINUSE':
console.error(bind + ' is already in use');
process.exit(1);
break;
default:
throw error;
}
}
/**
* Event listener for HTTP server "listening" event.
*/
function onListening() {
const addr = server.address();
const bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr?.port;
debug('Listening on ' + bind);
}
56 changes: 56 additions & 0 deletions dist/data/theaters.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
[
{
"loc": "https://www.canalolympia.com/theaters/wologuede/"
},
{
"loc": "https://www.canalolympia.com/theaters/yennenga/"
},
{
"loc": "https://www.canalolympia.com/theaters/idrissa-ouedraogo/"
},
{
"loc": "https://www.canalolympia.com/theaters/bessengue/"
},
{
"loc": "https://www.canalolympia.com/theaters/yaounde/"
},
{
"loc": "https://www.canalolympia.com/theaters/mpita/"
},
{
"loc": "https://www.canalolympia.com/theaters/poto-poto/"
},
{
"loc": "https://www.canalolympia.com/theaters/alima/"
},
{
"loc": "https://www.canalolympia.com/theaters/mandjiozangue/"
},
{
"loc": "https://www.canalolympia.com/theaters/kaloum/"
},
{
"loc": "https://www.canalolympia.com/theaters/tombolia/"
},
{
"loc": "https://www.canalolympia.com/theaters/hippodrome/"
},
{
"loc": "https://www.canalolympia.com/theaters/teranga/"
},
{
"loc": "https://www.canalolympia.com/theaters/godope/"
},
{
"loc": "https://www.canalolympia.com/theaters/mide/"
},
{
"loc": "https://www.canalolympia.com/theaters/iarivo/"
},
{
"loc": "https://www.canalolympia.com/theaters/mararaba/"
},
{
"loc": "https://www.canalolympia.com/theaters/rebero/"
}
]
Loading

0 comments on commit ea9c35d

Please sign in to comment.