Skip to content

Commit

Permalink
feat: [test, config, multi-url]: Clean code and Added multi url for r…
Browse files Browse the repository at this point in the history
…outes
  • Loading branch information
hsk11 committed Sep 8, 2024
1 parent a95a489 commit 7f33bc8
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jai-server",
"version": "1.5.4",
"version": "1.5.5",
"description": "Fast , simple and powerful web framework for creating REST APIs for your next project. RESTFul API server",
"keywords": [
"server",
Expand Down
2 changes: 1 addition & 1 deletion src/lib/request/errorHandler.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const ErrorHandler500=(res:any,error:any) => {
error= error instanceof Error ? error : error?.toString();
//console.log(error);
console.log(error);
if (!res.headersSent) {
res.writeHead(500, { 'Content-Type': 'application/json' });
res.write(JSON.stringify({ statusCode: 500, message: 'Internal Server Error - Jai Server', error: error?.message||error }));
Expand Down
1 change: 0 additions & 1 deletion src/lib/response/httpPrototype.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ const responsePrototype: Partial<ExtendedServerResponse> = {
},
async sendFile(filePath: string, options: Partial<sendFileOptions> = {}, callback: Function) {
if(!options) options = {};
console.log(options)
if(!Object.prototype.hasOwnProperty.call(options,'fallthrough')) options.fallthrough=false;
return await sendFile(path.resolve(filePath), options, this as unknown as ExtendedServerResponse, {}, callback);

Expand Down
1 change: 0 additions & 1 deletion src/serverProto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ function createProto(config: JaiServerConfig, routes:Router): JaiProto {
const proto = {
...routes,
listen(port: number, host: string = config.host || '', ...args: any[]): JaiServer {
// console.log('listen', this.requestHandler, this.requestHandler.stack);
const server: JaiServer = JaiServerFactory.createJaiServer(config, routes);
this.server = server;
return this.server.listen(port||config.pot, host, ...args);
Expand Down

0 comments on commit 7f33bc8

Please sign in to comment.