This is the error I get: HTTP-Fehler 405.0 - Method Not Allowed
I try to send from my HTML>FROM/Action:test.js>test.js
to get it in my sqlite3 Database, but I don't get it. What is going wrong?
Here my HTML code:
<form action="test.js" method="post">
<input type="text" name="Gehalt" value="">
<input type="submit" value="Senden">
</form>
My test.js
is in the same folder!
const sqlite3 = require('sqlite3').verbose();
const express = require('express');
const bodyParser = require('body-parser')
var app = express();
var urlencodedParser = bodyParser.urlencoded({ extended: false })
app.use(bodyParser());
let Gehalt
console.log("hier soll");
app.post('test.js', urlencodedParser, function (req, res) {
//var url = req.body;
console.log(req.body);
//Gehalt = req.body.url
});