FilesystemAPIService.js 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * Copyright (C) 2024 Puter Technologies Inc.
  3. *
  4. * This file is part of Puter.
  5. *
  6. * Puter is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU Affero General Public License as published
  8. * by the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU Affero General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Affero General Public License
  17. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  18. */
  19. const BaseService = require("./BaseService");
  20. class FilesystemAPIService extends BaseService {
  21. async ['__on_install.routes'] () {
  22. const { app } = this.services.get('web-server');
  23. // batch
  24. app.use(require('../routers/filesystem_api/batch/all'))
  25. // v2 -- also in batch
  26. app.use(require('../routers/filesystem_api/write'))
  27. app.use(require('../routers/filesystem_api/mkdir'))
  28. app.use(require('../routers/filesystem_api/delete'))
  29. // v2 -- not in batch
  30. app.use(require('../routers/filesystem_api/stat'));
  31. app.use(require('../routers/filesystem_api/touch'))
  32. app.use(require('../routers/filesystem_api/read'))
  33. app.use(require('../routers/filesystem_api/token-read'))
  34. app.use(require('../routers/filesystem_api/readdir'))
  35. app.use(require('../routers/filesystem_api/copy'))
  36. app.use(require('../routers/filesystem_api/move'))
  37. app.use(require('../routers/filesystem_api/rename'))
  38. // v1
  39. app.use(require('../routers/writeFile'))
  40. app.use(require('../routers/file'))
  41. // misc
  42. app.use(require('../routers/df'))
  43. }
  44. }
  45. module.exports = FilesystemAPIService;