var methodOverride = require('method-override') code example

Example: require method-override

'use strict';
// Application dependencies
const express = require('express');
const cors = require('cors');
const superagent = require('superagent');
const pg = require('pg');
const methodOverride = require('method-override');

// Application setup
require('dotenv').config();
const app = express();
const PORT = process.env.PORT || 3000;
const client = new pg.Client(process.env.DATABASE_URL);
app.use(cors());

app.use(express.urlencoded({extended: true}));
 app.set('view engine', 'ejs')

app.use(methodOverride('_method'))