This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { Parser } = require('json2csv') | |
//example database model (Modeling MongoDB with Mongoose) | |
const Log = require('../models/logModel') | |
const responseCsv = async (req, res) => { | |
let logs | |
try { | |
//reading logs from the database | |
//append .lean() to get a plain JS object rather than a mongoose document; use less memory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const readCsv = async () => { | |
try { | |
//read .csv file on a server | |
const target = `https://SOME_DOMAIN.com/data/csv/[FILENAME].csv`; | |
//target can also be api with req.query | |
//get csv-structure-response from a server | |
//const target = `https://SOME_DOMAIN.com/api/data/log_csv?[QUERY]`; | |
const res = await fetch(target, { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.1' | |
services: | |
nginx: | |
container_name: NGIX_CONTAINER_NAME | |
image: nginx:1.18.0-alpine | |
restart: always | |
volumes: | |
- ./config/nginx/vhost.conf:/etc/nginx/conf.d/default.conf | |
- ./log/nginx:/var/log/nginx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.1' | |
services: | |
wordpress: | |
container_name: WORDPRESS_CONTAINER_NAME | |
image: wordpress:5.7-apache | |
restart: always | |
volumes: | |
- ./wordpress:/var/www/html | |
ports: |