Commit 0e2091bf authored by Yoann HOUPERT's avatar Yoann HOUPERT

allow more content-type for wav

parent 8cf0a9e8
Pipeline #8168 passed with stage
in 26 seconds
......@@ -54,6 +54,9 @@ typings/
# Yarn Integrity file
.yarn-integrity
#HTTPS server certificat
ssl/*.pem
tmp/
nohup.out
models/
......@@ -19,7 +19,6 @@
*/
const https = require('https');
const fs = require('fs');
const app = require('express')();
const bodyParser = require('body-parser');
......@@ -28,7 +27,18 @@ const routes = require('./lib/webserver/routes');
console.log('starting routes linstt-controller...');
app.use(bodyParser.raw({type: 'audio/wav', limit: '200mb'}));
app.use(bodyParser.raw({type: 'audio/wave', limit: '200mb'}));
app.use(bodyParser.raw({type: 'audio/x-wav', limit: '200mb'}));
app.use(bodyParser.raw({type: 'audio/x-pn-wa', limit: '200mb'}));
app.use(bodyParser.raw({type: 'audio/vnd.wave', limit: '200mb'}));
app.use((req, res, next) => {
res.header('Access-Control-Allow-Origin', '*');
res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept');
next();
});
app.use('/', routes.routesFactory(config.orchestrator));
app.listen(config.api, () => {
......
......@@ -4,7 +4,13 @@ Create a transcript text from an audio file
**Request Headers:**
- Accept: application/json
Content-Type :
- audio/wav
- audio/wave
- audio/x-wav
- audio/x-pn-wa
- audio/vnd.wave
**Request Body**
......@@ -49,3 +55,4 @@ This endpoint expects the request body to be a wav file
{
status : X , err : 'here the error'
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment