Issues Post for the Express side of my Valkarie Crusade Private server development

Results 1 to 9 of 9
  1. #1
    Member panicdotc is offline
    MemberRank
    Nov 2017 Join Date
    HellLocation
    35Posts

    Post Issues Post for the Express side of my Valkarie Crusade Private server development

    so i have talked about my issues regarding the logging of connected urls(Fixed thanks to timebomb) and the removal of all 404 errors(fixed by myself didnt work sadley)
    this post is for the Express code used in my server since i aint no expert on express but i am a great coder
    Last edited by panicdotc; 15-05-18 at 08:22 PM. Reason: new title and post reason


  2. #2
    Programmer TimeBomb is online now
    ModeratorRank
    May 2008 Join Date
    United StatesLocation
    1,268Posts

    Re: how to make a nodejs http server that logs all info throwed at it

    Check out the morgan middleware, it's awesome for request logging in express. Moving this thread to the main section since logging in an http server isn't all that related to reverse engineering.

  3. #3
    Member panicdotc is offline
    MemberRank
    Nov 2017 Join Date
    HellLocation
    35Posts

    Re: how to make a nodejs http server that logs all info throwed at it

    seems like it will fix my logging issue know any solusions on removing the 404 error since it propley crashes VC
    Last edited by panicdotc; 14-05-18 at 01:22 PM. Reason: formatting fix

  4. #4
    Programmer TimeBomb is online now
    ModeratorRank
    May 2008 Join Date
    United StatesLocation
    1,268Posts

    Re: how to make a nodejs http server that logs all info throwed at it

    Quote Originally Posted by panicdotc View Post
    seems like it will fix my logging issue know any solusions on removing the 404 error since it propley crashes VC
    We can't know what your problem is here unless you elaborate or show us the problem in code. Either way, why do you think it's happening in the first place? Is there an error that you're not catching somewhere, do you not expect it to return 404 in the first place, is someone accessing a page they shouldn't be on your server, or...?

  5. #5
    Member panicdotc is offline
    MemberRank
    Nov 2017 Join Date
    HellLocation
    35Posts

    Re: how to make a nodejs http server that logs all info throwed at it

    Quote Originally Posted by TimeBomb View Post
    We can't know what your problem is here unless you elaborate or show us the problem in code. Either way, why do you think it's happening in the first place? Is there an error that you're not catching somewhere, do you not expect it to return 404 in the first place, is someone accessing a page they shouldn't be on your server, or...?
    i had to figure out where the error handling of the 404 error whas but i figured out myself sothe issue is fixed
    this whas the piece of code i had to change:
    Code:
    app.use(function(req, res, next) {
      next(createError(404)); // create a 404(Not Found) error
    });
    
    with this new new code:
    Code:
    app.use(function(req, res, next) {
      next(createError(200)); // make that an 200(OK) Code
    });
    
    butadded the feature but it didnt prvend VC from spitting out errors sadly
    well at least i changed it from error 7(Networking issue) to a nice classy Error 2(also a networking failure)

    i keep this threat open for other issues i have to feel free to help me with them
    Last edited by panicdotc; 15-05-18 at 08:17 PM. Reason: extra info

  6. #6
    Veni, Vidi, Vici Arcelor is offline
    Alpha MaleRank
    Jan 2010 Join Date
    Delhi, IndiaLocation
    1,794Posts

    Re: Issues Post for the Express side of my Valkarie Crusade Private server developmen

    Why don't you just redirect * to a custom page instead of throwing an error?

  7. #7
    Member panicdotc is offline
    MemberRank
    Nov 2017 Join Date
    HellLocation
    35Posts

    Re: Issues Post for the Express side of my Valkarie Crusade Private server developmen

    Quote Originally Posted by Arcelor View Post
    Why don't you just redirect * to a custom page instead of throwing an error?
    this whas easier also code 200 is not a error its OK i tried removing it but that did some funky shit

  8. #8
    :-) s-p-n is offline
    DeveloperRank
    Jun 2007 Join Date
    Next DoorLocation
    2,156Posts

    Re: Issues Post for the Express side of my Valkarie Crusade Private server developmen

    About next... you can pass a router to next() or nothing at all.
    I think you meant to use `res.end()`- unless createError returns an express router.

  9. #9
    Member panicdotc is offline
    MemberRank
    Nov 2017 Join Date
    HellLocation
    35Posts

    Re: Issues Post for the Express side of my Valkarie Crusade Private server developmen

    thanks for helping everyone i have been started a other project to i think i am gona halt that one until i have the full src



Advertisement