![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
@dramaorg/facere-rerum
Advanced tools
<!-- Please do not edit this file. Edit the `blah` field in the `package.json` instead. If in doubt, open an issue. -->
An easy to use web framework for Node.js.
# Using npm
npm install --save @dramaorg/facere-rerum
# Using yarn
yarn add @dramaorg/facere-rerum
const Lien = require("@dramaorg/facere-rerum");
// Init @dramaorg/facere-rerum server
const server = new Lien({
port: 9000
, public: `${__dirname}/public`
});
// Listen for load
server.on("load", err => {
console.log(err || "Server started on port 9000.");
err && process.exit(1);
});
// Add page
server.get("/", @dramaorg/facere-rerum => {
@dramaorg/facere-rerum.end("Hello World");
});
// Add a dynamic route
server.get("/post/:id", @dramaorg/facere-rerum => {
@dramaorg/facere-rerum.end("Post id: " + @dramaorg/facere-rerum.params.id);
});
// Add a static file
server.get("/test", "index.html");
// Listen for server errors
server.on("serverError", err => {
console.log(err.stack);
});
There are few ways to get help:
LienCreator(req, res, next, server)
Creates the @dramaorg/facere-rerum
object.
req
: The request object.res
: The response object.next
: The next
middleware function.server
: The Lien
server instance.next()
Go to the next middleware handler.
Lien
instance.redirect(newUrl, query)
Redirects the c@dramaorg/facere-rerumt to another url.
newUrl
: The new url to redirect to.query
: If true
, the request querystring parameters will be appended. If it's an object, it will be merged with the request querystring parameters.render(template, data)
Renders a template to the c@dramaorg/facere-rerumt.
template
: The template name.data
: The template data.startSession(data)
Starts a session.
data
: The session data.setSessionData(data)
Sets the session data.
data
: The session data.getSessionData(field)
Returns the session data object/specific field.
field
: A specific field to get from the session object.destroySession()
Destroys the session.
header(name, value)
Gets/sets/deletes headers.
name
: The header name.value
: The header value to set. If null
, the header will be removed.apiMsg(msg, status)
Sends to the c@dramaorg/facere-rerumt a JSON object containing the message
field.
msg
: The API message.status
: The status code (default: 200
).apiError(msg, status)
Like apiMsg
, but by default with a status code of 422
.
msg
: The API message.status
: The status code (default: 422
).end(content, status, contentType, headers)
Ends the response sending the content.
content
: The content that should be sent to the response.status
: The status code.contentType
: The content type (e.g. "json"
).headers
: Additional headers to send in the response.cookie(cookie, value)
Sets, gets or deletes the cookie.
cookie
: The searched cookie.value
: If provided and it not null
, the cookie will be set. If it's null, the cookie will be deleted. If value
is not provided, the cookie value will be returned.null
, if the cookie was deleted. undefined
if the cookie doesn't exist. The cookie value if this exists.file(path, customRoot)
Serves a file to the response.
path
: Relative path to the file.customRoot
: Absolute path to the root directory (optional).Lien(opt_options)
Creates a new Lien instance.
It extends the EventEmitter
class.
It emits the following events:
load
(err): After the server is started. If there are no errors, the err
will be null.serverError
(err, req, res): This is emitted when something goes wrong after the server is started.error
(err): Errors which may appear during the server initialization.opt_options
: An object containing the following properties:
host
(String): The server host.
port
(Integer): The server port. process.env.PORT
is used, default is 3000
.
session
(Boolean|Object): Enable the session support. If it's an object, it will be merged with the following defaults and passed to express-session
:
secret
(String): This is the secret used to sign the session ID cookie (default: "@dramaorg/facere-rerum server").resave
(Boolean): Forces the session to be saved back to the session store, even if the session was never modified during the request (default: false).saveUninitialized
(Boolean): Forces a session that is "uninitialized" to be saved to the store (default: true
).cookie
(Object): The cookie options.storeOptions
(Object): The session store options. These options are passed to the session store you choose.store
: (String|Function): The session store name or function. By default it's using a memory store if the session is enabled.public
(String|Array): The path to the public directory or an array of arrays in this format: ["/url/of/static/dir", "path/to/static/dir"]
.
Example:
[
["/images", "path/to/images"]
, ["/", "path/to/public"]
]
ssl
(Object): An object containing the following fields:
key
(String): The path to the key file.cert
(String): The path to the cert file._key
(String|Buffer): The key file content (defaults to the key file content)._cert
(String|Buffer): The cert file content (defaults to the cert file content).views
path
(String): The path to the views directory.name
(String): The view engine name.errorPages
(Object):
notFound
(String|Function): The path to a custom 404 page or a function receiving the @dramaorg/facere-rerum object as parameter. This can be used to serve custom 404 pages.serverError
(String|Function): The path to a custom 500 page or a function receiving the @dramaorg/facere-rerum object as parameter. This can be used to serve custom 500 pages.badCsrf
(String|Function): The path to a custom bad CSRF page or a function receiving the @dramaorg/facere-rerum object as parameter. This can be used to serve custom bad CSRF errors.logErrors
(Boolean): Log the server errors (default: true
).
csrf
(Object): The CSRF options. These are passed to csurf
bodyParserJson
(Boolean): Whether to enable the JSON body parser (default: true
)
bodyParserUrlEncoded
(Boolean): Whether to enable the URL encoded body parser (default: true
)
cookieParser
(Boolean): Whether to enable the cookie parser (default: true
)
transformers
(Boolean): Whether to enable the transformers (default: true
)
addStaticPath(url, localPath)
Adds a new static path to the server.
url
: The static path url endpoint.localPath
: The local path to the directory.addPage(url, method, output)
Adds a new page to be handled.
url
: The page url.method
: The request methods to be handled (default: "all"
) or an object:
method
(String): The HTTP method.before
(Array|Function): A function or an array of middleware functions to be executed before the main function.after
(Array|Function): A function or an array of middleware functions to be executed after the main function.output
: A function receiving the @dramaorg/facere-rerum
object as parameter. If can be a path serving a public file.errorPages(options)
Handle the error pages.
options
: An object containing the following fields:notFound
(String|Function): The path to a custom 404 page or a function receiving the @dramaorg/facere-rerum object as parameter. This can be used to serve custom 404 pages.serverError
(String|Function): The path to a custom 500 page or a function receiving the @dramaorg/facere-rerum object as parameter. This can be used to serve custom 500 pages.getHooks(type, url, method)
Gets the transformer for a url.
type
: The hook type (before
or after
).url
: The url.method
: The method.null
.getHooksStrict(type, url, method)
Similar to getHooks
, but doesn't concat hooks based on the regex
matching but only if they are the same regex.
type
: The hook type (before
or after
).url
: The url.method
: The method.null
.insertHook(type, url, method, trans)
Inserts a new hook.
type
: The hook type (before
, after
, custom:name
).url
: The url.method
: The method.trans
: The transformer to insert.hook(where, url, method, cb, transType)
Adds a new hook.
where
: The hook type (before
or after
).url
: The route url.method
: The HTTP method.cb
: The callback function.transType
: The transformer type.before(url, method, cb, transType)
Adds a before hook. It will handle all the subroutes of the url
.
url
: The route url.method
: The HTTP method.cb
: The callback function.transType
: The transformer type.after(url, method, cb, transType)
Adds a before hook. It will handle all the subroutes of the url
.
url
: The route url.method
: The HTTP method.cb
: The callback function.transType
: The transformer type.use(url, method, cb, transType)
Use this function to add middleware handlers.
url
: The route url.method
: The HTTP method.cb
: The callback function.transType
: The transformer type.add(url, method, cb)
Adds a new middleware. Note: This will not trigger the hooks.
url
: The endpoint url.method
: The HTTP method (default: all
).cb
: The callback function.Have an idea? Found a bug? See how to contribute.
I open-source almost everything I can, and I try to reply to everyone needing help using these projects. Obviously, this takes time. You can integrate and use these projects in your applications for free! You can even change the source code and redistribute (even resell it).
However, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it:
Starring and sharing the projects you like :rocket:
—I love books! I will remember you after years if you buy me one. :grin: :book:
—You can make one-time donations via PayPal. I'll probably buy a
coffee tea. :tea:
—Set up a recurring monthly donation and you will get interesting news about what I'm doing (things that I don't share with everyone).
Bitcoin—You can send me bitcoins at this address (or scanning the code below): 1P9BRsmazNQcuyTxEqveUsnf5CERdq35V6
Thanks! :heart:
If you are using this library in one of your projects, add it in this list. :sparkles:
@dottjt/mediareade
@everything-registry/sub-chunk-2069
bloggify
bloggify-cli
bloggify-prebuilt
bloggify-server-prebuilt
bnotify
chewb-youtube-uploader
fb-token-updater
gh-contributions
learning-node-file-upload
learning-nodejs-file-upload
@dramaorg/facere-rerum-github-comments-example
nodejs-youtube-uploader
test-youtube-api
web-term
wrabbit
youtube-album-uploader
youtube-album-uploader-multiple
FAQs
security holding package
The npm package @dramaorg/facere-rerum receives a total of 0 weekly downloads. As such, @dramaorg/facere-rerum popularity was classified as not popular.
We found that @dramaorg/facere-rerum demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.