Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/g0v-it/data-agcom.git
Browse files Browse the repository at this point in the history
  • Loading branch information
ecow committed May 21, 2019
2 parents 5057dfc + ceb0277 commit dd3c7ac
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
9 changes: 5 additions & 4 deletions apis/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@ ENV WORK_DIR /usr/src/app/
WORKDIR $WORK_DIR

#FOR develop
RUN npm install -g nodemon
#RUN npm install -g nodemon

# Install app dependencies
COPY package*.json ./
RUN npm install
RUN npm install rdflib --save

RUN npm install &&\
npm install rdflib --save

#FOR_DEV
RUN mv $WORK_DIR/node_modules /node_modules
#RUN mv $WORK_DIR/node_modules /node_modules

COPY . .
EXPOSE 80
Expand Down
7 changes: 5 additions & 2 deletions apis/controllers/account-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ partition4 = "p4_editore" ;
//const http = require('http'),

const {URL} = require('url'),
csv = require('csvtojson'),
csv = require('csvjson'),
zip = require('lz-string'),
querystring = require('querystring');

Expand Down Expand Up @@ -133,7 +133,10 @@ function getQueryResult(endpoint, query, format = DEFAULT_ACCEPT){
async function buildJsonFilter(data, group){
return new Promise(async (resolve, reject) =>{
try{
let output, result = await csv().fromString(data);
let output, result = await csv.toObject(data, {
delimiter : ',',
quote : '"'
});

output = {};
result.map(d => {
Expand Down
10 changes: 4 additions & 6 deletions apis/package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
{
"name": "data-agcom-apis",
"version": "1.0.0",
"description": "data-budget APIs for g0v agcom visualization applications (see README.md)",
"description": "data-agcom APIs for g0v budget visualization applications (see README.md)",
"author": "Yassine Ouahidi",
"license": "MIT",
"repository": "https://github.com/g0v-it/data-agcom",
"main": "app.js",
"scripts": {
"start": "node app.js"
},
"devDependencies": {
"chai": "^4.1.1",
"mocha": "^3.5.0"
},
"dependencies": {
"csvtojson": "^2.0.8",
"csvjson": "^5.1.0",
"express": "^4.16.3",
"lz-string" : "^1.4.4"
}
Expand Down

0 comments on commit dd3c7ac

Please sign in to comment.