Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@danielres/smtp-mini-dev-server

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@danielres/smtp-mini-dev-server - npm Package Compare versions

Comparing version 1.3.0 to 1.4.0

templates/helpers.js

14

index.js

@@ -7,2 +7,4 @@ #!/usr/bin/env node

const templates = require("./templates");
const PORT = process.env.DEV_SMTP_PORT || 2500;

@@ -20,3 +22,3 @@ const API_PORT = process.env.DEV_SMTP_API_PORT || 2501;

// return callback(new Error("Invalid username or password"));
callback(null, { user: 123 }); // dummy user to simulate auth success
callback(null, { user: "dummyUser" }); // using a dummy user to simulate auth success
},

@@ -36,7 +38,13 @@ logger: true,

app.get("/message/:messageId", (req, res) => {
app.get("/", (req, res) => {
const headers = ["messageId", "from", "to", "subject"];
const messages = Object.values(mailbox).reverse();
res.send(templates.home({ messages }));
});
app.get("/:messageId", (req, res) => {
res.json(mailbox[req.params.messageId]);
});
app.get("/message/:messageId/:field", (req, res) => {
app.get("/:messageId/:field", (req, res) => {
const { field, messageId } = req.params;

@@ -43,0 +51,0 @@ res.send(mailbox[messageId][field]);

@@ -10,3 +10,3 @@ {

},
"version": "1.3.0",
"version": "1.4.0",
"main": "index.js",

@@ -13,0 +13,0 @@ "license": "MIT",

@@ -56,3 +56,3 @@ # SMTP mini dev server

if (error) return reject(error);
const url = `http://localhost:2501/message/${info.messageId}/html`;
const url = `http://localhost:2501/${info.messageId}/html`;
console.log({ url });

@@ -71,6 +71,7 @@ resolve({ info, response, url });

- visit `http://localhost:2501/message/${info.messageId}` to view all data related to a paticular message.
- view only specific data:
- `http://localhost:2501/message/${info.messageId}/html`
- `http://localhost:2501/message/${info.messageId}/text`
- visit `http://localhost:2501` for a list of all received messages.
- visit `http://localhost:2501/<MESSAGE_ID>` for all data related to a paticular message.
- view only specific data for a message:
- `http://localhost:2501/<MESSAGE_ID>/html`
- `http://localhost:2501/<MESSAGE_ID>/text`
- ...
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc