sless-examples/simple-node/code/time_getter/time_getter.js
2026-03-09 17:57:29 +04:00

11 lines
627 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Создано: 2026-03-09
// time_getter.js — функция запускается как Job (одноразово).
// Возвращает JSON со временем запуска. Оператор v0.1.16 захватывает stdout
// и записывает его в sless_job.run_getter.message — оттуда terraform передаёт
// значение в sless_function.display через env_var JOB_TIME.
exports.getTime = function(event) {
// Возвращаем время в ISO 8601 UTC — без зависимостей, только stdlib
return { time: new Date().toISOString() };
};