You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
563 B
26 lines
563 B
const express = require('express'); |
|
const path = require('path'); |
|
global.expect = require('expect.js'); |
|
global.fetch = require('node-fetch'); |
|
global.Tesseract = require('../src'); |
|
|
|
const app = express(); |
|
let devServer = null; |
|
|
|
global.startServer = (done) => { |
|
if (devServer === null) { |
|
app.use('/', express.static(path.resolve(__dirname, '..'))); |
|
devServer = app.listen(3000, done); |
|
} else { |
|
done(); |
|
} |
|
}; |
|
|
|
global.stopServer = (done) => { |
|
if (devServer !== null) { |
|
devServer.close(done); |
|
devServer = null; |
|
} else { |
|
done(); |
|
} |
|
};
|
|
|