![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.
APX (pronounced 'apex') is a modern API server designed to serve multiple communication mediums. That relies on modern popular packages such as express, kue, socket.io, winston, object-manage to make configuration and two-way communication a breeze.
APX is built to be test friendly out of the box and comes with a testing
setting in the configuration that will use mock services and increase testing speed.
Well we have evaluated and contributed to several other API servers and just kept running into deficiencies or failure to use a popular library or not light weight enough.
Thus, we created APX. Its lightweight uses lots of modern packages and wires them all together in an extensible loading environment.
APX can be used homogeneously or through our generator.
$ npm install apx
app.js
var Apx = require('apx')
var server = new Apx({
config: ['config.json'],
tasks: ['tasks/*.js'],
translators: [require('apx-express')]
winston: {file: 'foo.log'}
})
Our generator is a yeoman generator instance that will scaffold your entire API server.
//install the generator
$ npm install generator-apx
//scaffold the initial app
$ yo apx
//scaffold a new action (with test)
$ yo apx:action <name>
//scaffold a new helper (with test)
$ yo apx:helper <name>
//scaffold a new initializer
$ yo apx:initializer <name>
//scaffold a new model
$ yo apx:model <name>
//scaffold a new service (with test)
$ yo apx:service <name>
//scaffold a new test (with test)
$ yo apx:task <name>
//scaffold a new translator
$ yo apx:translator <name>
APX consists of several well known idioms
Actions are the bread and butter of an API server they serve all requests and build responses. Actions are also in charge of firing non periodic tasks and utilizing services.
Helpers do not get loaded by the APX loading service however helpers
are meant to be common modules that assist actions and tasks. Generally
these are libraries that augment the req
,res
variables.
Initializers get executed when the server starts up and are only executed once. These are useful for setting up database connections and loading additional items into the environment.
Models are optional, but since using models to store data has become so common it seems silly not to support them in context and generators. Models do not get loaded by the Apx framework but can be added during an initializer or per action or task.
Services are just libraries that are treated as singletons. Services should be used to maintain in memory information and provide access to data providers. Models are services but services are not necessarily models.
Tasks are jobs that are ran either periodically or scheduled to run by an action. Tasks are considered headless and while they consume request data. They do not provide response data. They can, however, log using winston.
In other frameworks these are sometimes called "servers". Translators are the
middleware that consumes connections and produce generic Request
and Response
objects. An example of a translator would be an express HTTP server.
Clustering in APX is a breeze. Simply use cluster-master
Here is a quick example
app.js
var Apx = require('./apx')
new Apx({
cwd: __dirname + '/app',
cluster: ('production' === process.env.NODE_ENV),
config: ['config.json'],
initializers: ['initializers/*.js'],
tasks: ['tasks/*.js'],
translators: ['translators/*.js']
})
server.js
var clusterMaster = require('cluster-master')
clusterMaster({
exec: 'app.js',
env: {NODE_ENV: 'production'},
repl: {address: '127.0.0.1', port: 3002}
})
To start the cluster simply run
$ node server
APX uses object-manage to load and manage configuration data.
testing
false
Testing mode will use fakeredis as much as possible and will not start listening on any ports. However it will still offer a full featured environment for writing tests. Testing mode will also not start Kue which should not be needed to test tasks.
cwd
''
The current working directory is used when loading actions, services, and tasks.
kue.port
The port that the kue web interface will listen on.
kue.title
APX Job Status
The title of the Kue web interface
initializers
[]
An array of globs or objects or absolute file paths. That should be executed when the server is started.
tasks
[]
An array of globs or objects or absolute file paths. That will resolve to tasks.
This must be provided at config time to they can be loaded into Kue and scheduled if needed.
translators
[]
An array of globs or objects or absolute file paths. That will resolve to translators that should be started when the server is started
Below configuration options allow for basic
winston transport configuration. Additional
transports should be set in initializers
.
winston.console
true
Enables the console transport for winston.
winston.file
''
Filename for winston file transport to point to.
FAQs
A scalable, extensible, modular API Server
The npm package apx receives a total of 0 weekly downloads. As such, apx popularity was classified as not popular.
We found that apx 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
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.