Skip to content

Commit

Permalink
support use of a file prefix for batches
Browse files Browse the repository at this point in the history
  • Loading branch information
birm authored Jan 6, 2023
1 parent 92c5f90 commit d5e91d0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions handlers/fileHandlers.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
const fs = require('fs').promises;
const uuid = require("uuid");
var file_prefix = process.env.file_prefix;

// write a file containing the request body
function writeFile(path, prefix) {
return function(req, res, next) {
if (file_prefix){
prefix = file_prefix + "_" + prefix;
}
let fn = prefix + "_" + uuid.v4() + ".json";
const json = JSON.parse(req.body);
json.create_date = new Date();
Expand Down

0 comments on commit d5e91d0

Please sign in to comment.