修改小程序,前端,官网跳转路径
This commit is contained in:
27
government-backend/test-api.js
Normal file
27
government-backend/test-api.js
Normal file
@@ -0,0 +1,27 @@
|
||||
const http = require('http');
|
||||
|
||||
const options = {
|
||||
hostname: 'localhost',
|
||||
port: 5352,
|
||||
path: '/api/slaughter/slaughterhouses',
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Authorization': 'Bearer mock-jwt-token-test',
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
};
|
||||
|
||||
const req = http.request(options, (res) => {
|
||||
console.log(`状态码: ${res.statusCode}`);
|
||||
console.log(`响应头: ${JSON.stringify(res.headers)}`);
|
||||
|
||||
res.on('data', (d) => {
|
||||
process.stdout.write(d);
|
||||
});
|
||||
});
|
||||
|
||||
req.on('error', (error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
req.end();
|
||||
Reference in New Issue
Block a user