GithubHelp home page GithubHelp logo

web5design / city_developer_resources Goto Github PK

View Code? Open in Web Editor NEW

This project forked from codeforamerica/city_developer_resources

0.0 3.0 0.0 466 KB

API and Open Source project documentation site for cities that (hopefully) doesn't suck.

city_developer_resources's Introduction

City Developer API Documentation

An API documentation app for cities that doesn't suck

Development

8/24/2012 The documentation for this app is currently under development. Please check back soon for updates.

Deployment

Apache

This API documentation app works great with the Apache2 web server. It assumes the following Apache site configuration:

  • Apache is configured with the mod_rewrite module enabled (you can use a2enmod rewrite to enable this module if need be)

  • A virtual server instance (or default) is configured with AllowOverride all on the app's root directory - example:

      <VirtualHost *:80>
          ServerAdmin webmaster@localhost
          DocumentRoot /var/www/[your_site]
          <Directory />
                  Options FollowSymLinks
                  AllowOverride None
          </Directory>
          <Directory /var/www/[your_site]>
                  Options Indexes FollowSymLinks MultiViews
                  AllowOverride all
                  Order allow,deny
                  allow from all
          </Directory>
      </VirtualHost>
    

note: if any changes were made to enable mod_rewrite and/or configure a virtual host then you must restart apache

Once you have set your main Apache configuration, you can simply clone this application into the root directory you defined in the VirtualHost configuration. For example, if you said the VirtualHost document root is /var/www/api_docs, then you can run:

$ cd /var/www
$ git clone \
    git://github.com/codeforamerica/city_developer_resources.git \
    api_docs

Now you will have the api documentation app available on your server at /var/www/api_docs.

Note that the app root folder includes an .htaccess file. This file contains the necessary redirection for using the HTML5 History API (pushState) and the release distribution assets and looks like this:

# Remove the trailing slash from routes
DirectorySlash Off

# Enable the RewriteEngine
RewriteEngine on

# Map resources to release distribution
RewriteRule ^app/(.*)$ dist/release/$1 [NC,L]
RewriteRule ^assets/js/libs/(.*)$ dist/release/$1 [NC,L]
RewriteRule ^assets/css/(.*)$ dist/release/$1 [NC,L]

# These conditions ensure that the file does not exist and that the current
# request URI is not the index.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !index

# Redirect remaining requests to the index.html file
RewriteRule (.*) index.html [NC,L]

You can modify this file as required but please be cautions about changing the RewriteRules since they are absolutly required in order for this application to function properly.

At this point, you should be able to navigate to the directory on your server that is hosting the instance of the app and view it.


MISC NOTES:

City of Chicago Developer Resources (current): http://www.cityofchicago.org/city/en/narr/foia/sample_code0.html

This app was tested with:

Node: 0.6.18
NPM: 1.1.21
bbb: 0.1.10

city_developer_resources's People

Contributors

boundsj avatar bensheldon avatar mr0grog avatar

Watchers

JT5D avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.