alfaarghya / alfa-leetcode-api

It's a custom leetcode api. This API provides endpoints to retrieve details about a user's profile, badges, solved questions, contest details, contest history, submissions, calendar and and also daily questions, selected problem, list of problems.
https://alfa-leetcode-api.onrender.com/
MIT License
142 stars 58 forks source link

typescript refactor + testing #5

Closed jamesh48 closed 3 months ago

jamesh48 commented 3 months ago

Managed to refactor the project to use typescript, and also added a single test to hopefully get more of.

alfaarghya commented 3 months ago

🎉 Thanks for your contribution! ☺️ Your code looks great, and I appreciate the thoroughness of your work. The refactoring you implemented in TypeScript is well done, and I have reviewed everything. I'm happy to approve it for merging. 🚀 Thanks again for your valuable contribution 😄

jamesh48 commented 3 months ago

You are welcome! I appreciate the collaboration as well. This is my first open source PR so I appreciate you bringing me along. Remember, for the deployment you will need to invoke npm run build before npm start.

alfaarghya commented 3 months ago

@jamesh48 Once again thanks for your contribution😊. The server is live now with your code🚀.

image
jamesh48 commented 3 months ago

@jamesh48 Once again thanks for your contribution😊. The server is live now with your code🚀.

image

It's running the dev script directly, I'm not sure how you have your ci/cd configured but you would probably get a very modest performance improvement if you first compiled the typescript into javascript using the npm run build command, and then npm start. The purpose of typescript is more for the developer experience as opposed to actually running typescript code in production

alfaarghya commented 3 months ago

@jamesh48 codebase is running on a free tier server and npm run build available for paid version only. So I could not do anything 😔

jamesh48 commented 3 months ago

available

There's a hack we can leverage, I have it in the new PR

"prestart"

When invoking npm run start the prestart script will run automatically to build the code