-
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
1 parent
899c8b3
commit fac98a9
Showing
33 changed files
with
1,141 additions
and
1,398 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,27 +1,42 @@ | ||
"use strict"; | ||
var express = require('express'); | ||
var bodyParser = require('body-parser'); | ||
var config = require('config'); | ||
require('dotenv').config(); | ||
require('./onStartup'); | ||
var app = express(); | ||
app.use(bodyParser.json()); | ||
app.use(bodyParser.urlencoded({ extended: true })); | ||
app.use(function (req, res, next) { | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const express_1 = __importDefault(require("express")); | ||
const body_parser_1 = __importDefault(require("body-parser")); | ||
const http_1 = require("http"); | ||
const account_1 = __importDefault(require("./routers/account")); | ||
const accessAuthorization_1 = __importDefault(require("./routers/accessAuthorization")); | ||
const app = (0, express_1.default)(); | ||
// (async() => { | ||
// const redisDB = redis.connection(); | ||
// const result = await redisDB.sendCommand(['SCAN', '0', 'MATCH', '*::eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9*', 'COUNT', '10000']); | ||
// // const result = await redisDB.get('*::dfdsfdgdgdgdf') | ||
// console.log({ result }); | ||
// // scan 0 MATCH emer*******[email protected]::* COUNT 10000 | ||
// })() | ||
app.use(body_parser_1.default.json()); | ||
app.use(body_parser_1.default.urlencoded({ extended: true })); | ||
app.use((req, res, next) => { | ||
res.set('Access-Control-Allow-Origin', '*'); | ||
res.set('Access-Control-Allow-Headers', 'Content-Type'); | ||
console.log("\n ----------------------------\n NEW REQUEST: ".concat(req.url, ";\n DATE: ").concat(new Date(), ";\n ----------------------------\n ")); | ||
console.log(` | ||
---------------------------- | ||
NEW REQUEST: ${req.url}; | ||
DATE: ${new Date()}; | ||
---------------------------- | ||
`); | ||
next(); | ||
}); | ||
app.get('/', function (req, res) { | ||
app.get('/', (req, res) => { | ||
res.json({ | ||
title: '!nfinity-API', | ||
author: 'Emerson-Britto', | ||
description: "account manager api" | ||
}); | ||
}); | ||
var accountRouter = require('./routers/account'); | ||
app.use('/account', accountRouter); | ||
var filesRouter = require('./routers/files'); | ||
app.use('/files', filesRouter); | ||
module.exports = app; | ||
app.use('/account', account_1.default); | ||
app.use('/authorization', accessAuthorization_1.default); | ||
const httpServer = (0, http_1.createServer)(app); | ||
exports.default = httpServer; |
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,6 +1,8 @@ | ||
"use strict"; | ||
module.exports = [ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const authorizedServices = [ | ||
/^https:\/\/web-musiky.vercel.app/g, | ||
/^https:\/\/www-nord.vercel.app/g, | ||
/^http:\/\/localhost\:3000/g | ||
]; | ||
exports.default = authorizedServices; |
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,47 +1,35 @@ | ||
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
if (typeof b !== "function" && b !== null) | ||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
var InvalidArgumentError = /** @class */ (function (_super) { | ||
__extends(InvalidArgumentError, _super); | ||
function InvalidArgumentError(msg) { | ||
var _this = _super.call(this, msg) || this; | ||
_this.name = 'InvalidArgumentError'; | ||
_this.msg = msg; | ||
return _this; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.InvalidTokenError = exports.InvalidService = exports.InternalServerError = exports.InvalidArgumentError = void 0; | ||
class InvalidArgumentError extends Error { | ||
constructor(msg) { | ||
super(msg); | ||
this.name = 'InvalidArgumentError'; | ||
this.msg = msg; | ||
} | ||
return InvalidArgumentError; | ||
}(Error)); | ||
var InternalServerError = /** @class */ (function (_super) { | ||
__extends(InternalServerError, _super); | ||
function InternalServerError(msg) { | ||
var _this = _super.call(this, msg) || this; | ||
_this.name = 'InternalServerError'; | ||
_this.msg = msg; | ||
return _this; | ||
} | ||
exports.InvalidArgumentError = InvalidArgumentError; | ||
class InvalidTokenError extends Error { | ||
constructor(msg) { | ||
super(msg); | ||
this.name = 'InvalidTokenError'; | ||
this.msg = msg; | ||
} | ||
return InternalServerError; | ||
}(Error)); | ||
var InvalidService = /** @class */ (function (_super) { | ||
__extends(InvalidService, _super); | ||
function InvalidService(msg) { | ||
var _this = _super.call(this, msg) || this; | ||
_this.name = 'InvalidService'; | ||
_this.msg = msg; | ||
return _this; | ||
} | ||
exports.InvalidTokenError = InvalidTokenError; | ||
class InternalServerError extends Error { | ||
constructor(msg) { | ||
super(msg); | ||
this.name = 'InternalServerError'; | ||
this.msg = msg; | ||
} | ||
return InvalidService; | ||
}(Error)); | ||
module.exports = { InvalidArgumentError: InvalidArgumentError, InternalServerError: InternalServerError, InvalidService: InvalidService }; | ||
} | ||
exports.InternalServerError = InternalServerError; | ||
class InvalidService extends Error { | ||
constructor(msg) { | ||
super(msg); | ||
this.name = 'InvalidService'; | ||
this.msg = msg; | ||
} | ||
} | ||
exports.InvalidService = InvalidService; |
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,2 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
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,2 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
Oops, something went wrong.