mirror of
https://github.com/bellingcat/datasheet-server.git
synced 2026-06-14 22:38:30 +03:00
update config
This commit is contained in:
12
src/config.js
Normal file
12
src/config.js
Normal file
@@ -0,0 +1,12 @@
|
||||
import { tabs, prefixedTabs } from './lib'
|
||||
|
||||
export default {
|
||||
gsheets: [],
|
||||
xlsx: [
|
||||
{
|
||||
name: 'timemap_data',
|
||||
path: 'data/timemap_data.xlsx',
|
||||
tabs
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -3,7 +3,6 @@ import express from 'express'
|
||||
import initialize from './initialize'
|
||||
import middleware from './middleware'
|
||||
import api from './api'
|
||||
// import config from './sheets_config'
|
||||
import dotenv from 'dotenv'
|
||||
const hbs = require('express-handlebars')
|
||||
|
||||
@@ -41,6 +40,8 @@ initialize(controller => {
|
||||
})
|
||||
)
|
||||
|
||||
app.use(express.static(__dirname + '/public'))
|
||||
|
||||
app.server.listen(process.env.PORT || 4040, () => {
|
||||
console.log('===========================================')
|
||||
console.log(`Server running on port ${app.server.address().port}`)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import StoreJson from './models/StoreJson'
|
||||
import fetchers from './lib/Fetcher'
|
||||
import Controller from './lib/Controller'
|
||||
import config from './sheets_config'
|
||||
import config from './config'
|
||||
import R from 'ramda'
|
||||
|
||||
const isntNull = n => n !== null
|
||||
|
||||
21
src/lib.js
Normal file
21
src/lib.js
Normal file
@@ -0,0 +1,21 @@
|
||||
import BP from './lib/blueprinters'
|
||||
|
||||
export function prefixedTabs (prefix) {
|
||||
return {
|
||||
[`${prefix}_export_events`]: BP.deeprows,
|
||||
[`${prefix}_export_categories`]: [BP.groups, BP.rows],
|
||||
[`${prefix}_export_filters`]: BP.tree,
|
||||
[`${prefix}_export_narratives`]: BP.rows,
|
||||
[`${prefix}_export_sources`]: BP.deepids,
|
||||
[`${prefix}_export_sites`]: BP.rows
|
||||
}
|
||||
}
|
||||
|
||||
export const tabs = {
|
||||
export_events: BP.deeprows,
|
||||
export_categories: [BP.groups, BP.rows],
|
||||
export_filters: BP.tree,
|
||||
export_narratives: BP.rows,
|
||||
export_sources: BP.deepids,
|
||||
export_sites: BP.rows
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
import fs from 'mz/fs'
|
||||
import errors from '../lib/errors'
|
||||
|
||||
const STORAGE_DIRNAME = 'temp'
|
||||
const STORAGE_DIRNAME = 'data'
|
||||
|
||||
function partsFromFilename (fname) {
|
||||
const body = fname.slice(0, -5)
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
import BP from './lib/blueprinters'
|
||||
|
||||
const timemapStructure = {
|
||||
export_events: BP.deeprows,
|
||||
export_categories: [BP.groups, BP.rows],
|
||||
export_narratives: BP.rows,
|
||||
export_sources: BP.deepids,
|
||||
export_sites: BP.rows,
|
||||
export_tags: BP.tree
|
||||
}
|
||||
|
||||
const treatyStructure = {
|
||||
treaty_export_events: BP.deeprows,
|
||||
treaty_export_categories: [BP.groups, BP.rows],
|
||||
export_narratives: BP.rows,
|
||||
treaty_export_sources: BP.deepids,
|
||||
export_sites: BP.rows,
|
||||
export_tags: BP.tree
|
||||
}
|
||||
|
||||
const moraldriftStructure = {
|
||||
moraldrift_export_events: BP.deeprows,
|
||||
moraldrift_export_categories: [BP.groups, BP.rows],
|
||||
moraldrift_export_narratives: BP.rows,
|
||||
moraldrift_export_sources: BP.deepids,
|
||||
moraldrift_export_sites: BP.rows,
|
||||
moraldrift_export_tags: BP.tree
|
||||
|
||||
}
|
||||
|
||||
export default {
|
||||
gsheets: [{
|
||||
name: 'example',
|
||||
id: '1UC7DkCFeUXHfpUxUGruExwFbP4pqVBdJLOKfo6wDDGk',
|
||||
tabs: timemapStructure,
|
||||
}],
|
||||
|
||||
|
||||
xlsx: [
|
||||
/** {
|
||||
name: 'my_local_sheet',
|
||||
tabs: timemapStructure,
|
||||
path: 'temp/my_local_sheet.xlsx'
|
||||
} **/
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user