forked from SoloLa-Platform/soloroom-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
49 lines (43 loc) · 1.38 KB
/
vue.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/* eslint-disable no-unused-vars */
/* eslint-disable no-console */
/* eslint-disable consistent-return */
/* eslint-disable max-len */
const bodyParser = require('body-parser');
const readline = require('readline');
const fs = require('fs');
// const xml = require('xml');
// const path = require('path');
module.exports = {
outputDir: 'dist',
assetsDir: 'static',
// chainWebpack: config => {
// config.resolve.alias
// .set('@', path.resolve(__dirname, '/src'));
// },
devServer: {
// proxy: {
// '/api*': {
// // Forward frontend dev server request for /api to django dev server
// // target: 'http://localhost:8000/',
// }
// },
before(app) {
app.use(bodyParser.urlencoded());
app.use(bodyParser.json());
app.post('/sheet/demo', (req, res) => {
let content = '';
const rl = readline.createInterface({
input: fs.createReadStream(`${__dirname}/mock/MozartTrio.musicxml`),
});
rl.on('line', (line) => {
content += `${line}`;
});
rl.on('close', () => {
res.set('Content-Type', 'text/xml');
// res.type('application/xml');
res.send(content);
});
})
}
}
}