first commit
This commit is contained in:
21
backend.js
Normal file
21
backend.js
Normal file
@ -0,0 +1,21 @@
|
||||
const express = require('express');
|
||||
|
||||
const app = express();
|
||||
|
||||
app.use((req, res, next) => {
|
||||
res.header('Access-Control-Allow-Origin', '*');
|
||||
res.header('Access-Control-Allow-Methods', 'GET, POST, OPTIONS');
|
||||
res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept');
|
||||
next();
|
||||
});
|
||||
|
||||
|
||||
app.post('/press', (req, res) => {
|
||||
res.send('Antwort vom Node Server: hello world');
|
||||
console.log("empfangen")
|
||||
});
|
||||
|
||||
|
||||
app.listen(3000, () => {
|
||||
console.log('Server is running');
|
||||
});
|
||||
Reference in New Issue
Block a user