2
0

setup-crowi.js 371 B

123456789101112131415161718
  1. import Crowi from '~/server/crowi';
  2. let _instance = null;
  3. export async function getInstance(isNewInstance) {
  4. if (isNewInstance) {
  5. const crowi = new Crowi();
  6. await crowi.initForTest();
  7. return crowi;
  8. }
  9. // initialize singleton instance
  10. if (_instance == null) {
  11. _instance = new Crowi();
  12. await _instance.initForTest();
  13. }
  14. return _instance;
  15. }