Here is my form.html
<form action="/submit" method="post" enctype="multipart/form-data">
Email<br>
<input type="email" tabindex="-1" class="email-field" name="email" placeholder="Your email address..."><br><input class="btn btn-primary btn-xl js-scroll-trigger"type="submit" value="Submit">
</form>
and here is app.js
var http = require('http');
var express = require('express');
var fs = require('fs');
app = express.createServer();
app.configure(function(){
app.set('port', process.env.PORT || 3000);
app.use(express.logger('dev'));
app.use(express.bodyParser());
});
app.post('/submit', function(req, res) {
fs.appendFile('emailDatabase.txt', req.body.email, function (err) {
if (err) throw err;
console.log('Saved!');
});
});
And I'm getting error Cannot POST /submit
I've only 1 form I want to process and app.js is all my "backend".Those 2 files are in the same dir
It all seems to be fine or should I define routes ??
Basically it is just landing page to create email database
Firebase Cloud Functions: PubSub, "res.on is not a function"
TypeError: Cannot read properties of undefined (reading 'createMessageComponentCollector')
I'm building a desktop background service that should be cross platformI'm going to write this service as a node
getting extra content in mail body
when use above code, i got res :
How do I submit the form? I have a simple search bar and a search buttonThe following enters the search string, but the click event is not fired