Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
@dtorn/contact-api-core
Advanced tools
The `API` that handles all contact-related requests from a website that implements it as the backend
The API
that handles all contact-related requests from a website that implements it as the backend.
Node.js version: 12.20.0
npm install @dtorn/contact-api-core --save
root
-- config
---- data.json
---- development.js
---- index.js
---- local.js
---- production.js
---- staging.js
-- language
---- el.js // any 'language code' could be here as long as it's added to the index.js's default language
---- index.js
-- public
---- images
-------- favicon.ico
-------- logo.png
.env
.env.development
.env.local
.env.production
.env.staging
index.js
// config/data.json
{
"users": [
{
"id": "671ec03e-edbb-4a3d-8dda-05558e05b0d0"
}
]
}
// config/index.js
require("dotenv").config();
const local = require("./local");
const development = require("./development");
const staging = require("./staging");
const production = require("./production");
let config;
switch (process.env.NODE_ENV) {
case "local":
config = local;
break;
case "development":
config = development;
break;
case "staging":
config = staging;
break;
case "production":
config = production;
break;
default:
config = local;
break;
}
module.exports = config;
// config/local.js
const Local = {
apiPath: "",
apiVersion: "",
protocol: "",
domain: "",
url: "",
website: {
domain: "",
url: "",
},
email: {
contact: "",
administrator: "",
},
launchYear: 0,
preferences: {
sendMessageEmail: false,
},
};
module.exports = Local;
// language/index.js
const EL = require("./el");
module.exports = {
el: EL,
default: "el",
};
// language/EL.js
module.exports = {
identity: {
brandName: "",
legalName: "",
address: "",
postalCode: "",
country: "",
email: "",
phone: "",
},
name: "",
phone: "",
email: "",
message: "",
thankYouTitle: "",
thankYouForContactingUs: "",
messageReceived: "",
cantSeeThisMessage: "",
viewItInBrowser: "",
messageSent: "",
yourContactDetails: "",
thankYouMessage: "",
moto: "",
contactForm: {
title: "",
clientSubject: "",
},
};
// index.js
require("contact-api-core");
Create a new .env
file for each development environment. Usually it would be:
.env
: the current debug environment.env.local
: local environment.env.development
: development environment (continuous integration).env.staging
: staging environment (release testing).env.production
: production environmentlocal
– used for workstation testing, e.g. http://localhost:8000
development
– used for development testing, e.g. https://dev.{DOMAIN_NAME}
staging
– used for release testing, e.g. https://sta.{DOMAIN_NAME}
production
– used for production, e.g. https://{DOMAIN_NAME}
# sample-env file
# NODE_ENV
# ENCRYPTION_KEY
# JWT_TOKEN_KEY
# JWT_TOKEN_EXPIRATION
# DB_USERNAME
# DB_PASSWORD
# DB_DATABASE
# DB_HOST
# DB_DIALECT
# EMAIL_HOST
# EMAIL_USERNAME
# EMAIL_PASSWORD
# Configure .env files
echo .sample-env > .env.local
echo .sample-env > .env.development
echo .sample-env > .env.staging
echo .sample-env > .env.production
echo .env.local > .env
1.0.11
1.0.10
{ id: '...' }
instead of { user: { id: '' } }
1.0.9
1.0.8
1.0.8-beta
1.0.7
libs/external-request-verification-handler.js
libs/encrypt.js
1.0.6
1.0.5
1.0.4
1.0.3
1.0.2
1.0.1
1.0.0
email.administrator
FAQs
The `API` that handles all contact-related requests from a website that implements it as the backend
We found that @dtorn/contact-api-core demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.