Dev builds public JSON API for Lineage 2 server tracker, shares key lessons
A developer launched L2 Calendar, a tracker for Lineage 2 private server openings, to help players find upcoming servers and give owners a place to announce launches. The project recently expanded to include a public JSON API, built as a route handler within the same Next.js app rather than a separate service. A production bug caused by mysql2 returning DATE columns as strings but DATETIME columns as JavaScript Date objects led to a TypeError crash, highlighting the importance of normalizing data types at the boundary layer. CORS was enabled selectively on the read-only API route to allow browser and Discord bot access without affecting the security of admin or auth routes. The developer's key takeaways were to always normalize dates at the data layer, cache shared queries with a TTL, and make public data freely accessible to encourage third-party tools.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in