'https://myTestServer/uploadImg'так получаю ошибку
https://mytestserver/uploadImg/так работает
app.post('/uploadImg', async (req, res) => {
location /uploadImg/хотя странно, так как первий сервис с запросами без слеша в конце работает… проавда там файлы не принимаются
var mas1 = [
[1, 2, 3, 6, 0, 8, 5, 4, 7, 9],
[2, 1, 8, 6, 5, 9, 7, 0, 4, 3],
[7, 6, 1, 5, 8, 4, 2, 9, 3, 0],
[2, 6, 5, 7, 4, 0, 8, 1, 3, 9],
[0, 8, 6, 2, 7, 9, 4, 5, 3, 1],
[5, 7, 8, 0, 6, 9, 2, 4, 3, 1],
[0, 6, 5, 3, 8, 7, 1, 2, 9, 4],
[9, 7, 8, 6, 3, 0, 1, 5, 2, 4],
[1, 0, 5, 9, 2, 7, 3, 6, 4, 8],
[6, 2, 9, 4, 1, 0, 8, 5, 3, 7]
]
function IpsEncodeString(source) {
var i, j, k;
source = source.replace(/\D/g,"");
result = '';
i, j = 0;
for (i = 1; i <= source.length-1; i++){
k = mas1[j, parseInt(source[i])];
result += k;
j++;
if (j >= 10){
j = 0
}
}
return result
}
OPTIONS /dstnat/?param1=somedata¶m2=somedata 200 9.461 ms - 4
res.header('Access-Control-Allow-Methods', 'POST,GET,OPTION');
{headers: { 'Access-Control-Allow-Origin': '*'}}
#!/bin/bash
### BEGIN INIT INFO
# Provides: myscript
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 1 0 6
# Short-Description: simple description.
### END INIT INFO
SMS_NAME=sms_app
CUR_NAME=currency_app
NODE_ENVIROMENT=production
SMS_FORSTOP=/home/scorpio/web_server/sms/bin/www
CUR_FORSTOP=/home/scorpio/web_server/EXPRESS/bin/www
smslogfile=/var/log/$SMS_NAME.log
curlogfile=/var/log/$CUR_NAME.log
forever=forever
start() {
export NODE_ENV=$NODE_ENVIROMENT
# echo "Starting $SMS_NAME app : "
touch $smslogfile
$forever start -a -l $smslogfile $SMS_FORSTOP
echo "Starting $CUR_NAME app : "
touch $curlogfile
$forever start -a -l $curlogfile $CUR_FORSTOP
RETVAL=$?
}
restart() {
echo -n "Restarting all : "
$forever restart $SMS_FORSTOP
$forever restart $CUR_FORSTOP
RETVAL=$?
}
status() {
echo "Status for all:"
$forever list
RETVAL=$?
}
stop() {
echo -n "Shutting down all : "
$forever stop $SMS_FORSTOP
$forever stop $CUR_FORSTOP
}
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status
;;
restart)
restart
;;
*)
echo "Usage: {start|stop|status|restart}"
exit 1
;;
esac
exit $RETVAL
update-rc.d myscript defaults
insserv myscript
service my script status
service myscript stop