Metacity
  • Welcome
  • Metacity
    • Installation
    • [dev] CGAL Dependency
    • Data Import
    • Models and Attributes
    • Layers
    • Grids
    • Quad-trees
    • Dockerized Processor
    • Development notes
  • Archives
    • DataAPI
      • Development
    • MetacityGL
      • Installation
      • Creating a MetacityGL App
      • Writing Custom Layers
      • Loading Metacity Data
      • Development notes
    • BananaGL
      • Development
    • AMOS
      • Synthetic Population
        • Case Studies
        • Data Specification
        • Activity Chains
        • Spatial Distribution
        • MATSim population input and comparison
        • Households
      • MATSim
        • Basic Info
        • Running Scenario
          • Config File
          • Current state
        • Input information
          • OSM
          • Filtering GTFS
          • Coordinates
        • Output
          • Processing
      • OICT
        • MapResolver
      • Resources
        • Trafic Simulation
        • MATSim
        • Vis and Meta Software
        • Synthetic Population
        • Public Relations
        • Inspiration
    • Metacity Block Edition
      • Epic Games Mega Grant
      • 🧠Internal notes
  • Links
    • Homepage
    • GitHub
  • Code of Conduct
Powered by GitBook
On this page
  • Release
  • Nginx Unit config
  • Nginx Config
Edit on GitHub
  1. Archives
  2. DataAPI

Development

Developer notes regarding DataAPI app

There are no special CIs set up for DataAPI at the moment.

Release

To update the live version of the front end on the server, you need to:

  1. log in into the sever via ssh

  2. go to dataapi where the application and python virtualenv is hosted

  3. pull newest version from github with git pull

  4. restart nginx unit with sudo systemctl restart unit

Nginx Unit config

The currently used config can be found in the repo.

Nginx Config

The nginx serves the data requests separately,

server {
    listen       80;
    server_name api.metacity.cc;

    location / {
        proxy_pass http://127.0.0.1:8080;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}

server {
    listen 80;
    server_name data.metacity.cc;

    gzip on;
    gzip_types      *;
    gzip_proxied    no-cache no-store private expired auth;
    gzip_min_length 1000;

    location / {
        # Simple requests
        if ($request_method ~* "(GET|POST)") {
            add_header "Access-Control-Allow-Origin"  *;
        }

        # Preflighted requests
        if ($request_method = OPTIONS ) {
            add_header "Access-Control-Allow-Origin"  *;
            add_header "Access-Control-Allow-Methods" "GET, POST, OPTIONS, HEAD";
            add_header "Access-Control-Allow-Headers" "Authorization, Origin, X-Requested-With, Content-Type, Accept";
            return 200;
        }

        root /home/monika/data;
    }
}

PreviousDataAPINextMetacityGL

Last updated 2 years ago