Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Cabal online NodeJS API + Web client

Joined
Jun 10, 2009
Messages
659
Reaction score
141
As this is Corona virus quarantine time I decided to build something useful for the Cabal community in this free time :8:.

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:

Web client Link:
 
Joined
May 21, 2011
Messages
418
Reaction score
73
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.
 
Joined
Jun 10, 2009
Messages
659
Reaction score
141
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.
 
Joined
Jun 10, 2009
Messages
659
Reaction score
141
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.
 
Banned
Banned
Joined
Apr 14, 2012
Messages
68
Reaction score
39
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!
 
Newbie Spellweaver
Joined
May 26, 2014
Messages
52
Reaction score
5
Very nice, I love node js, is perfect for my, tnx very much!
 
Elite Diviner
Joined
Jun 18, 2023
Messages
432
Reaction score
244
Can I use this API to integrate Discord?
 
Back
Top