Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Neocities – Developers API (neocities.org)
74 points by ulrischa on Dec 25, 2023 | hide | past | favorite | 61 comments



Fairly sure these docs are out of date wrt to the behavior of file extensions. Kyle infamously flipped an nginx switch last year to strip .html file extensions to give sites "clean URLs" (so if you have, for example, "/cyberspace/archive-the-web.html", it will give a 301 redirect to "/cyberspace/archive-the-web"), which is described in the latest Neocities blog post and unfortunately breaks the invariants that are expected by scripts and tools aimed at working with static sites.

(And, of course, as it generally goes without saying when someone labels something a "REST API", this is not REST, but that's a different topic.)


> this is not REST

I feel like almost every API could have this footnote.


What makes most APIs not REST?


When people are being pedantic, "REST" refers specifically to a set of architectural guidelines for application and API design, including things like statelessness and HATEOAS[1]. Most "REST" APIs don't adhere to these, and are just endpoints for shoving JSON around (sometimes with idiomatic HTTP verbs).

But this is pedantry. REST has become a generic term for "shoving JSON around," for better or worse.

[1]: https://en.wikipedia.org/wiki/HATEOAS


In the case of this one you have a POST to delete and a POST to upload. Instead of POST, PUT, and DELETE requests. Thats just from a quick glance.


REST is the “agile” of API design. Everyone says they do it, but everyone does it a little differently, and nobody adheres to the actual definition (because the actual definition is far too prescriptive to be fully applicable in reality)


Getting into deep pedantry here but I’m amused by the suggestion that the following is “too prescriptive”:

Individuals and interactions over processes and tools

Working software over comprehensive documentation

Customer collaboration over contract negotiation

Responding to change over following a plan

That is, while there is value in the items on the right, we value the items on the left more.


Yes. Agile is very malleable. SCRUM, which is what I assume the comment you're responding to means, is just one heavily prescriptive implementation of Agile. Of course these days people generally mean "SCRUM" when they say "Agile" which is likely due to many orgs blindly adopting the former. It's unfortunate but it is what it is, I guess.


What is REST?


It's the think that killed SOAP (and thank goodness it did).


This non-answer is about on par, where evasiveness is concerned, as the previous comment that I was responding to.

What's REST? What makes most APIs not REST?


Most of them fail to meet one of the requirements in the "uniform interface" section; generally, in my experience, either "self-descriptive messages" or "HATEOAS".


Aren't you supposed to use an index.html in the "/cyberspace/archive-the-web/" directory to get a URL like that? And if you wanted .html files to show up like that, the nginx try-files directive could just check if the URL would work if it had a .html on the end and do an internal redirect. (like how the default config on debian adds a / to the end, if that would work)

From my experience using nginx for amateur reasons, this seems like the wrong way to go about this. Not to mention the distaste I have for caching redirects, like 301. (they make fixing your config annoying, since browsers will redirect (and switch the verb to GET) before even hitting the server)


how do you deal with id changes/renames in actual rest?


Have an internal ID and one "public" ID. The public one can be mutated with PUT/PATCH calls that are idempotent, the internal ID never ever changes.


that's technically a title change.

real world systems might have to change actual ids. like the article. or say you grow to some other use case not covered before because of new regulation etc... 301 is the only rest way.


I never understood the appeal of neocities. What's the upside vs just dumping it on github pages?


Not having to learn Git to make a website, for one. Both my kids have a neocities website, github pages has an enormous barrier to entry compared to it.

Just google around, read some w3schools, type it into a textarea at neocities and woa, your own site.

Obviously this is only interesting for relatively nerdy types, but i don’t at all understand all the “why don’t people just <twenty cumbersome steps and tools>” comments that are here currently.

I know no place that makes having your own, self-built website, easier. And it’s free!


THIS! I've been maintaining a Neocities website for almost three years now. While, being a software engineer at heart, I still ultimately versioned the offline copy of my website via Git(lab), it's liberating to not have to wrestle with a git workflow just so I can hide my works-in-progress.

Also, in my case, a matter of branding. While I'm not trying to promote my content (a bunch of short stories and illustrations) so heavily, it just felt wrong for them to reside in Github/Gitlab subdomain. The closest I would've considered Git* pages is if I was doing sci-fi stories and that is still a "maybe". At the time I started my project, I was also worried I might run afoul of some content policy these Git platforms might have given that my website is not exactly for their demographic.


With Cloudflare pages, you can upload a .zip file via the web interface and that becomes your website. No git required.


Compare the copy on the landing pages and it’s pretty obvious

https://pages.cloudflare.com/

https://neocities.org/


But now you need to understand what files are, what zip is, what “upload” means and how it matters whether a file is on your computer or on a server, and so on. With neocities you can just type HTML into a box.


ok, that makes sense I guess.

Once you know how git/hub works, it seems much easier to me to use github, but I understand that not all people do; while all the other sites (squarespace, wix etc) are too much of "website builders". Fine thanks


I'm not a user of neocities, but I know plenty of people who do use it..and they all use it for reasons having to do with principles as well as fun, and less so about technology. The people i know who use neocities might consider github and other similar offerings as the continued centralization of all the things, where neocities would be considered "the alternative". Of course, if enough users also populate neocities and github, then we have less decentralization, and more of a duopoly...but still the folks i know who use it, just think of neocities as the scrappy offering alternative to the "big powers" - so not just against github but also other big web hosting powerrs who behave more centralized. In addition, and beyond the principles aspect, they often like neocities because its a bit nostalgic back when the web was weird, quirky, and more fun - and not so bland and corporate-like as it often seems to be these days. Final note, the people - that i know - that are neocities users are actually quite tech-savvy enough to use github, so its not that they lack the competency to use github, its just that they *choose* not to.


Neocities is not about to lock out a segment of the users by requiring 2FA.

https://docs.github.com/en/authentication/securing-your-acco...


Who is this going to lock out? Aren't TOTP apps available for every platform that can access GitHub?


Everyone not willing to carry around a device with them that can run arbitrary apps.


My point is, don't you already have a device that can run a TOTP app, namely the one you're using to access GitHub? You don't need a separate one. For example, KeePassXC can generate the codes on Windows, macOS, and Linux.


I'm not single-device. I can use a laptop but then I'd might be locked out whenever i don't have it with me.


You can have TOTP apps on all of your devices.


Can you get texts? GH supports SMS as a 2FA to my knowledge.


It's more of a platform than just a website dumping ground. You can tag your site and browse other people's websites, and most people on neocities have the same goal of making websites that are more old-school and less modern.

https://neocities.org/browse


github now engages in same bullshit that all big platform do with gaslighting/shadowbanning upon account creation. if it doesn't like you, for any reason or no reason at all, it doesn't actually prevent you from signing up, but your account is blacklisted and severely limited. in particular, your github pages won't work - you can do all the steps, but it never comes online, and it won't tell you shit.


I paid for Neocites but had to cancel and move elsewhere (Cloudflare atm) because it wasn't always updating files. I forget the exact issue but I went to report it on their Github and found a one or two year old issue opened already with no dev response, so I moved on.


I tossed em $100 of btc a while back cuz it gave you supporter access for life. Worth it even if you are the self hosted type. Imo

I’ve spun up so many one offs


What makes it good even for self-hosters? I have a lot of respect for Neocities but haven't used it since I have a VPS.


Just worth it _for me_

I make a lot of lil one offs, and I want a static page, and neocities (from main account) simply has an input box for a new site name, so I "spin up" w/o registration

neocities is cute, the spirit of it. I have no idea if they're still accepting $100 of btc, it was just appealing when I noticed once upon a time


Is there market for a Neocities or alternatives? I feel people who still believe in websites want to build them themselves and host them in a CDN. It is not (unfortauntely) the 90s or 2000s anymore, when people and teens wanted to have their own website. Now they want to have their own TikTok, Instagram and YouTube channel.


> It is not (unfortauntely) the 90s or 2000s anymore, when people and teens wanted to have their own website. Now they want to have their own TikTok, Instagram and YouTube channel.

And in another generation, it'll be something else.


Not all. There is another commenter here who says both their kids have neocities sites. And shit goes in circles, maybe more younger people will want their own websites again, who knows.


> Neocities is a social network of 700,800 web sites


Seems like neocities is not very popular. Are there any other good free alternatives with similar features - except from git based solutions?


Neocities is popular but only within a particular niche. There's a strikingly consistent topic and vibe among neocities-hosted sites compared to e.g. squarespace.

Neocities (sans neocities.org-subdomains):

https://search.marginalia.nu/search?query=as%3Aneocities+-si...

c.f. Squarespace:

https://search.marginalia.nu/search?query=as%3Asquarespace&p...

(disclosure: I built this search engine)


I've been maintaining a list on the sidebar here:

[1] https://potato.cheap

The following are also cool projects, but not included in my "cheap" web list due to too much javascript:

[2] https://univer.se

[3] https://mmm.page


Netlify doesnt require git. You can also just upload a folder.


Why the git exclusion?


You weren’t responding to me, but my guess it’s because git is 10x harder to learn than basic HTML and CSS.


I wouldn't consider basic git usage 10x that for most people


Git and HTML both deal with the (let's face it) complicated data structure we all know as trees.

The difference: You can fuck up an HTML tree and most browsers can still display your page[1], you can still get your message across. You fuck up a git history tree and you can somehow summon Cthulhu.

Not to mention, even if you can manage to stay away from branch confusion, just dealing with diffs is already a huge barrier for newbies.

[1] See "Where HTML 'beats' C" - Computerphile https://www.youtube.com/watch?v=-csXdj4WVwA


I may be blind to the learning problems since I know git already. But isn't it pretty hard to mess up a git repo if all you do is add+commit? (maybe combined into a "save" button in some UI) Then, asking someone who knows better when you want to do anything more complicated.

To me, just being able to save versions and look at them later (like saves in a video game) is such a huge boon that any of the more complicated features don't even need to be touched for git to be worth it.


I’ve helped teach a couple of those full stack web development boot camps a few years ago and you’d be surprised how many things you’d consider difficult to mess up that others will find impossibly difficult to grasp. Perfectly intelligent, rational people suddenly don’t know how to type a command i said like 10 seconds ago.


You can learn enough HTML to make a website without even properly understanding what files and directories are, let alone how to use a terminal.

And with Neocities, you also don’t need to understand what it means for files to be “local” or “on a server” because you just get a textarea that you can type your HTML into. (until you get to stuff like using your own images that is)

To do “basic git usage” you need to pretty deeply grok all of that before you can even begin to learn git itself. Just to publish a website!


What I like is the possibility to send a file to the API from a single board computer. Just a http call - no need to install git or webdav or ftp


I do not know of other hosting providers that offer a REST API for Upload/Delete


BunnyCDN, DigitalOcean and AWS all offer REST APIs to Upload/Delete pages.


I've found that REST Upload/Delete feels worse than FTP, or other similar protocols with like 45+ years of tool development.

There was once a HTTP standard called WebDav IIRC but it seems rarely implemented. Why haven't these sites tried that direction if they wanted HTTP-Backed security measures?

Upload/Delete as REST is usable though.


> ...There was once a HTTP standard called WebDav IIRC but it seems rarely implemented...

WebDAV is still a valid thing, and used quite more often than most people know. Its not known because it lives deeply embedded within apps and systems, and not something that is often visible to users. Case in point, a little thing called Google Drive makes use of WebDAV, so does NextCloud, etc.

WebDAV's not dead yet! (With apologies to Monty Python. ;-)


Neocities has WebDAV support, but it's limited to paid subscribers only (it's billed mainly as a way for you to "mount your Neocities [site]" as a virtual drive), and it's got a lot of the same annoyances that afflicts more or less every REST and quasi-REST service (where you have to tickle some URL over here in order to effect some resource over there).


I became a paid subscriber specifically to use their WebDAV features. I almost immediately unsubscribed as, at the time, I could not find a viable WebDAV client. I simply don't believe that this entire ecosystem supports it.


But they are not simple Webhosting providers


How is BunnyCDN not simple? You register, you top-up some money, you drag and drop your files on the web UI and it's live.

They give you a free subdomain with HTTPS (Let's Encrypt). If you want, you can bring your own domain too.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: