mirror of
https://github.com/neocities/neocities.git
synced 2025-04-25 01:32:36 +02:00
library list, require_login for custom_domain
This commit is contained in:
parent
48ec974195
commit
d83cef0e09
2 changed files with 13 additions and 2 deletions
2
app.rb
2
app.rb
|
@ -506,12 +506,12 @@ get '/password_reset_confirm' do
|
||||||
end
|
end
|
||||||
|
|
||||||
get '/custom_domain' do
|
get '/custom_domain' do
|
||||||
|
require_login
|
||||||
slim :custom_domain
|
slim :custom_domain
|
||||||
end
|
end
|
||||||
|
|
||||||
post '/custom_domain' do
|
post '/custom_domain' do
|
||||||
require_login
|
require_login
|
||||||
original_domain = current_site.domain
|
|
||||||
current_site.domain = params[:domain]
|
current_site.domain = params[:domain]
|
||||||
|
|
||||||
if current_site.valid?
|
if current_site.valid?
|
||||||
|
|
|
@ -27,6 +27,15 @@
|
||||||
</ul>
|
</ul>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
<h2>Libraries</h2>
|
||||||
|
<p>
|
||||||
|
There are client libraries available for popular programming languages to make it easier to work with the API:
|
||||||
|
<ul>
|
||||||
|
<li><a href="https://github.com/neocities/neocities-node" target="_blank">Node.js / JavaScript</a></li>
|
||||||
|
<li><a href="https://github.com/neocities/neocities-ruby" target="_blank">Ruby</a></li>
|
||||||
|
<li><a href="https://github.com/peterhellberg/neocities" target="_blank">Go</a> - contributed by <a href="https://twitter.com/peterhellberg" target="_blank">Peter Hellberg</a></li>
|
||||||
|
</ul>
|
||||||
|
</p>
|
||||||
<h2>API Documentation</h2>
|
<h2>API Documentation</h2>
|
||||||
<p>
|
<p>
|
||||||
The NeoCities API is a <a href="http://en.wikipedia.org/wiki/Representational_state_transfer" target="_blank">REST</a> API, which uses query parameters for input, and returns data in the <a href="http://en.wikipedia.org/wiki/JSON" target="_blank">JSON</a> format (except for file downloads). It uses client-side <a href="http://en.wikipedia.org/wiki/Basic_access_authentication" target="_blank">HTTP AUTH</a> to authenticate, using your user/site name and password as the credentials. It is designed to play nicely with the most common HTTP libraries available in programming languages, and can be easily used with <strong>cURL</strong> (a command-line tool for making HTTP requests you can use by opening a terminal on your computer).
|
The NeoCities API is a <a href="http://en.wikipedia.org/wiki/Representational_state_transfer" target="_blank">REST</a> API, which uses query parameters for input, and returns data in the <a href="http://en.wikipedia.org/wiki/JSON" target="_blank">JSON</a> format (except for file downloads). It uses client-side <a href="http://en.wikipedia.org/wiki/Basic_access_authentication" target="_blank">HTTP AUTH</a> to authenticate, using your user/site name and password as the credentials. It is designed to play nicely with the most common HTTP libraries available in programming languages, and can be easily used with <strong>cURL</strong> (a command-line tool for making HTTP requests you can use by opening a terminal on your computer).
|
||||||
|
@ -125,4 +134,6 @@ var api = new NeoCities('YOURUSERNAME', 'YOURPASSWORD')
|
||||||
api.info('madamfrp', function(resp) {
|
api.info('madamfrp', function(resp) {
|
||||||
console.log(resp)
|
console.log(resp)
|
||||||
})</pre>
|
})</pre>
|
||||||
</div> <!-- end .content -->
|
<h4>Need something the API doesn't provide?</h4>
|
||||||
|
<p>If the API does not supply something you need, <a href="/contact">contact us</a> and we will try to add it!
|
||||||
|
</div>
|
||||||
|
|
Loading…
Add table
Reference in a new issue