TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Cloc as a Service

1 pointsby zufallsheldalmost 2 years ago
Hey HN,<p>I wanted to show you my weekend(s) project: cloc[0] as a Service.<p>I&#x27;m learning golang and wanted to have a real project so I decided to build this over the curse of some weekends. I know there are websites that analyze repositories and spit out way more information, but nonetheless here&#x27;s my attempt.<p>The page is entirely written in golang (and html without any framework) and uses cloc to count the lines of code in the repository. It&#x27;s hosted on fly.io and uses Redis as a cache to store the results.<p>It doesn&#x27;t yet work for larger repositories because there&#x27;s a 60 second timeout in fly&#x27;s webproxy and I cannot program goroutines yet. :) Also for non-existing repos it just throws an error.<p>I also &quot;implemented&quot; an API, so you can just run:<p><pre><code> curl -X POST https:&#x2F;&#x2F;clocaas.fly.dev&#x2F;repo?name=dev-sec%2Fansible-collection-hardening </code></pre> and get the results on the cli.<p>Let me know what you think. :)<p>0: <a href="https:&#x2F;&#x2F;github.com&#x2F;AlDanial&#x2F;cloc">https:&#x2F;&#x2F;github.com&#x2F;AlDanial&#x2F;cloc</a>

no comments

no comments