made with NextJS and Directus headless CMS
Reinstall for prod or dev :
cd /to/my/app/path/
git clone [email protected]:DarioLopes/portfolio-2022.git .
npm i
npm run dev ## Or "npm run build" + pm2 for prod / add "-- --port 3000" to specify port
create next.config.js at the root for the url API and SVG support
/** @type {import('next').NextConfig} */
module.exports = {
reactStrictMode: true,
env: {
API: 'https://api.url.com', // Modify here
},
images: {
domains: ['api.url.com'], // Modify here
},
webpack(config) {
config.module.rules.push({
test: /\.svg$/,
use: ['@svgr/webpack'],
})
return config
},
}
And a simple nginx reverse proxy
server {
server_name www.mywebsite.com; # Modify here
location / {
proxy_pass http://localhost:3000/; # Default npm port
}
}
Install SSL with certbot
sudo certbot --nginx