We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
const express = require("express"); const bodyParser = require("body-parser"); const request = require("request"); const https = require("https");
const app = express();
app.use(express.static("public")); app.use(bodyParser.urlencoded({extended: true}));
app.get("/", function(req, res) { res.sendFile(__dirname + "/signup.html") });
app.post("/", function(req, res) { const firstName = (req.body.first_name); const lastName = (req.body.last_name); const email = (req.body.email); const data = { members: [ { email_address: email, status: "subscribed", merge_fields: { FNAME: firstName, LNAME: lastName, }
} ] }; const jsonData = JSON.stringify(data); const url = "https://us13.api.mailchimp.com/3.0/lists/e598f4082b"; const options = { method: "POST", auth: "Pinnacle:c72360e0a9e0b0039a7e9874ce26ee88-us13" } const request = https.get(url, options, function(response) { response.on(data, function (data) { console.log(JSON.parse(data)); }) }); console.log(request) request.write(jsonData); request.end();
})
app.listen(3000, function() { console.log("server is running on port 3000"); })
I ran this code and I got the error "throw er; // Unhandled 'error' event " on my hyper is terminal
The text was updated successfully, but these errors were encountered:
Sorry, something went wrong.
i've been stuck on this code for 2 days now 😥😥😪
No branches or pull requests
const express = require("express");
const bodyParser = require("body-parser");
const request = require("request");
const https = require("https");
const app = express();
app.use(express.static("public"));
app.use(bodyParser.urlencoded({extended: true}));
app.get("/", function(req, res) {
res.sendFile(__dirname + "/signup.html")
});
app.post("/", function(req, res) {
const firstName = (req.body.first_name);
const lastName = (req.body.last_name);
const email = (req.body.email);
const data = {
members: [
{
email_address: email,
status: "subscribed",
merge_fields: {
FNAME: firstName,
LNAME: lastName,
}
})
app.listen(3000, function() {
console.log("server is running on port 3000");
})
I ran this code and I got the error "throw er; // Unhandled 'error' event " on my hyper is terminal
The text was updated successfully, but these errors were encountered: