@@ -9,7 +9,7 @@ let router = new Router();
99
1010router . post ( '/user' , async ( ctx ) => {
1111 ctx . body = {
12- message : "User saved. "
12+ message : "User saved"
1313 } ;
1414} ) ;
1515
@@ -18,7 +18,7 @@ router.post('/image-form', async (ctx) => {
1818 let files = [ ] ;
1919 const { fields } = await busboy ( ctx . req , {
2020 onFile ( fieldname , file , filename , encoding , mimetype ) {
21- // 读取所有文件流( file stream),然后继续
21+ // read all file stream to continue
2222 let length = 0 ;
2323 file . on ( 'data' , function ( data ) {
2424 length += data . length ;
@@ -34,7 +34,7 @@ router.post('/image-form', async (ctx) => {
3434 } ) ;
3535
3636 ctx . body = {
37- message : `Image saved, firstName: ${ fields . firstName } , Image size:${ files [ 0 ] . length } , fileName: ${ files [ 0 ] . filename } . `
37+ message : `Image saved, firstName: ${ fields . firstName } , Image size:${ files [ 0 ] . length } , fileName: ${ files [ 0 ] . filename } `
3838 } ;
3939} ) ;
4040
@@ -44,7 +44,7 @@ router.post('/user-avatar', async (ctx) => {
4444 let files = [ ] ;
4545 const { fields } = await busboy ( ctx . req , {
4646 onFile ( fieldname , file , filename , encoding , mimetype ) {
47- // 读取所有文件流,然后继续
47+ // read all file stream to continue
4848 let length = 0 ;
4949 file . on ( 'data' , function ( data ) {
5050 length += data . length ;
@@ -61,7 +61,7 @@ router.post('/user-avatar', async (ctx) => {
6161 } ) ;
6262
6363 ctx . body = {
64- message : `User with picture, firstName: ${ fields . firstName } , picture size:${ files [ 0 ] . length } . `
64+ message : `User with picture, firstName: ${ fields . firstName } , picture size:${ files [ 0 ] . length } `
6565 } ;
6666} ) ;
6767
0 commit comments