Cabal online NodeJS API + Web client

Results 1 to 7 of 7
  1. #1
    Programmer cyberinferno is offline
    MemberRank
    Jun 2009 Join Date
    127.0.0.1Location
    707Posts

    thumbs up Cabal online NodeJS API + Web client

    As this is Corona virus quarantine time I decided to build something useful for the Cabal community in this free time .

    I have started building API endpoints for Cabal Online database in NodeJS as a hobby project.

    What is API? API is application programming interface. It's a standard way to access data across your web as well as mobile application!

    How can it help Cabal servers? You can use this API for building your own mobile application for your server to facilitate your players!

    Features available

    * Registration
    * Login

    I will be actively adding more features to both API as well as the example web client!

    API Link: https://github.com/cyberinferno/cabal-online-api

    Web client Link: https://github.com/cyberinferno/cabal-online-api-client


  2. #2
    Account Upgraded | Title Enabled! joel de paula is offline
    MemberRank
    May 2011 Join Date
    413Posts

    Re: Cabal online NodeJS API + Web client

    there are just some things to refactor there, like routes, use of an orm, and async / await to make the code more cute.

    About the routes I mentioned the refactoring because a file is having a lot of responsibility, I would think it better to separate what each route does in a different file and leave it just like that.

    "app.get ('/ account /: id', login.authorizedAuth, Account.searchUserId);" // Search

    I thought the use of express-json was cool, I could have used the normal one even more I thought it was cool, because it would avoid importing more library with the normal "jsonwebtoken" would use the verify method to check if the token is true.

    Besides, I thought the idea was very good ... I'm creating a dashboard and maybe I would use some validations that you used there.

  3. #3
    Programmer cyberinferno is offline
    MemberRank
    Jun 2009 Join Date
    127.0.0.1Location
    707Posts

    Re: Cabal online NodeJS API + Web client

    Quote Originally Posted by joel de paula View Post
    there are just some things to refactor there, like routes, use of an orm, and async / await to make the code more cute.

    About the routes I mentioned the refactoring because a file is having a lot of responsibility, I would think it better to separate what each route does in a different file and leave it just like that.

    "app.get ('/ account /: id', login.authorizedAuth, Account.searchUserId);" // Search

    I thought the use of express-json was cool, I could have used the normal one even more I thought it was cool, because it would avoid importing more library with the normal "jsonwebtoken" would use the verify method to check if the token is true.

    Besides, I thought the idea was very good ... I'm creating a dashboard and maybe I would use some validations that you used there.
    * Async/await makes the code more confusing in my opinion (at least for me). So used promise.
    * Using ORM is a good idea but most the ORM libraries need models to be defined for each tables which is a tedious process. Hence I did not use it to keep the code simple. ORM is an overkill in my opinion for MSSQL where many operations are done using SPs.
    * Each route in a different file is fine too. But I like keeping all related routes inside the same file to make it easier to find when needed.

  4. #4
    Cya nerds PunkS7yle is offline
    MemberRank
    Feb 2010 Join Date
    1,448Posts

    Re: Cabal online NodeJS API + Web client

    You should read up the theory on REST before you write up APIs.

  5. #5
    Programmer cyberinferno is offline
    MemberRank
    Jun 2009 Join Date
    127.0.0.1Location
    707Posts

    Re: Cabal online NodeJS API + Web client

    Quote Originally Posted by PunkS7yle View Post
    You should read up the theory on REST before you write up APIs.
    I know the theory well. I have tried to follow the rules while making the API as simple as possible. Following the rules strictly with just CRUD endpoints and implementing HATEOAS etc. isn't needed for this simple project. Wanted to make endpoints that make sense for anyone who wants to start using it quickly.

  6. #6
    Member Niicke is offline
    MemberRank
    Apr 2012 Join Date
    BrazilLocation
    63Posts

    Re: Cabal online NodeJS API + Web client

    What a boring people omg.. it's the developer's decision whether to use rest, orm, anything else.. None of these patterns or tools are mandatory for development.. congratulations for the initiative!

  7. #7
    Member Danynt is offline
    MemberRank
    May 2014 Join Date
    52Posts

    Re: Cabal online NodeJS API + Web client

    Very nice, I love node js, is perfect for my, tnx very much!



Advertisement