Yes, you can skip express But It ain't gonna be easy.
But there is something else :
is it possible to develop the web application without using ExpressJS
It can mean,
- you either use other frameworks, or
- Node.js web app from scratch
In the first case, you have options to choose from. There are MVC frameworks like hapi, Flicker.js etc, REST API frameworks like restify, loopback etc
In the second case, you are faced with the job of writing custom implementations of many features provided by express.
I'm continuing Assuming you meant the second case...
For creating the HTTP server, you can use node's HTTP Module
var http = require('http');
http.createServer(function (req, res) {
res.write('Hello World!');
res.end();
}).listen(8080);
This method makes it a pain to write a REST API
req.url; //the request URL
if(url == '/users/create')
{
//do this
}
else if(url == '/users/details')
{
//do that
}
To connect to postgres, you have to use node-postgres (pg) anyways (pg documentation)
const { Client } = require('pg')
const client = new Client()
await client.connect()
const res = await client.query('SELECT $1::text as message', ['Hello world!'])
console.log(res.rows[0].message) // Hello world!
await client.end()
As for the CRUD operations, apart from their API implementation, the code is going to be almost the same. So you can refer to the tutorials that use express.
https://mherman.org/blog/postgresql-and-nodejs/