MCPcopy Create free account
hub / github.com/DumbWareio/DumbDo / initDataFile

Function initDataFile

server.js:247–261  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

245
246// Ensure the data directory and file exist
247async function initDataFile() {
248 try {
249 await fs.access(DATA_DIR);
250 } catch {
251 await fs.mkdir(DATA_DIR);
252 }
253
254 try {
255 await fs.access(DATA_FILE);
256 } catch {
257 await fs.writeFile(DATA_FILE, JSON.stringify({}));
258 }
259
260 console.log('Todo list stored at:', DATA_FILE);
261}
262
263// Protected API routes
264app.get('/api/todos', async (req, res) => {

Callers 1

server.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected