From 961441c5c0f82c63dbeb232355db80114d6ac168 Mon Sep 17 00:00:00 2001 From: Tom Russell Date: Sun, 24 Feb 2019 12:17:59 +0000 Subject: [PATCH] Move api/tiles modules to subfolders --- app/src/{ => api}/building.js | 2 +- app/src/{ => api}/search.js | 2 +- app/src/{ => api}/user.js | 2 +- app/src/server.js | 8 ++++---- app/src/{ => tiles}/tile.js | 2 +- app/src/{ => tiles}/tileserver.js | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) rename app/src/{ => api}/building.js (99%) rename app/src/{ => api}/search.js (97%) rename app/src/{ => api}/user.js (99%) rename app/src/{ => tiles}/tile.js (98%) rename app/src/{ => tiles}/tileserver.js (99%) diff --git a/app/src/building.js b/app/src/api/building.js similarity index 99% rename from app/src/building.js rename to app/src/api/building.js index 84366fc8..9008dc69 100644 --- a/app/src/building.js +++ b/app/src/api/building.js @@ -2,7 +2,7 @@ * Building data access * */ -import db from './db'; +import db from '../db'; // data type note: PostgreSQL bigint (64-bit) is handled as string in JavaScript, because of // JavaScript numerics are 64-bit double, giving only partial coverage. diff --git a/app/src/search.js b/app/src/api/search.js similarity index 97% rename from app/src/search.js rename to app/src/api/search.js index 14f2ab1a..83138248 100644 --- a/app/src/search.js +++ b/app/src/api/search.js @@ -6,7 +6,7 @@ * - this DOES expose geometry, another reason to keep this clearly separated from building * data */ -import db from './db'; +import db from '../db'; function queryLocation(term){ const max_results = 5; diff --git a/app/src/user.js b/app/src/api/user.js similarity index 99% rename from app/src/user.js rename to app/src/api/user.js index cdb46b90..303da882 100644 --- a/app/src/user.js +++ b/app/src/api/user.js @@ -2,7 +2,7 @@ * User data access * */ -import db from './db'; +import db from '../db'; function createUser(user) { diff --git a/app/src/server.js b/app/src/server.js index 04ab8663..a29aeea0 100644 --- a/app/src/server.js +++ b/app/src/server.js @@ -16,7 +16,7 @@ import pgConnect from 'connect-pg-simple'; import App from './frontend/app'; import db from './db'; -import { authUser, createUser, getUserById, authAPIUser, getNewUserAPIKey } from './user'; +import { authUser, createUser, getUserById, authAPIUser, getNewUserAPIKey } from './api/user'; import { queryBuildingsAtPoint, queryBuildingsByReference, @@ -26,9 +26,9 @@ import { saveBuilding, likeBuilding, unlikeBuilding -} from './building'; -import { queryLocation } from './search'; -import tileserver from './tileserver'; +} from './api/building'; +import { queryLocation } from './api/search'; +import tileserver from './tiles/tileserver'; import { parseBuildingURL } from './parse'; // create server diff --git a/app/src/tile.js b/app/src/tiles/tile.js similarity index 98% rename from app/src/tile.js rename to app/src/tiles/tile.js index 318f408b..652bdc77 100644 --- a/app/src/tile.js +++ b/app/src/tiles/tile.js @@ -6,7 +6,7 @@ import path from 'path'; import mapnik from 'mapnik'; import SphericalMercator from '@mapbox/sphericalmercator'; -import { strictParseInt } from './parse'; +import { strictParseInt } from '../parse'; // connection details from environment variables const DATASOURCE_CONFIG = { diff --git a/app/src/tileserver.js b/app/src/tiles/tileserver.js similarity index 99% rename from app/src/tileserver.js rename to app/src/tiles/tileserver.js index 0ac53407..8e9cf86b 100644 --- a/app/src/tileserver.js +++ b/app/src/tiles/tileserver.js @@ -5,7 +5,7 @@ import express from 'express'; import { render_tile } from './tile'; -import { strictParseInt } from './parse'; +import { strictParseInt } from '../parse'; // tiles router const router = express.Router()