Skip to content

Instantly share code, notes, and snippets.

@avermeulen
Last active October 4, 2020 12:28
Show Gist options
  • Select an option

  • Save avermeulen/9c8d2012123be7ba0140fe39ff47dd5b to your computer and use it in GitHub Desktop.

Select an option

Save avermeulen/9c8d2012123be7ba0140fe39ff47dd5b to your computer and use it in GitHub Desktop.

Deploy and Oracle Jet App using Heroku

  • Move your Oracle Jet folder into your ExpressJS API folder
  • Or create a new folder for an small ExpressJS application

Delete these in the Oracle Jet app folder:

  • the .git folder - use rm -rf .git
  • the .gitignore file - use rm .gitignore

Create new folder for a small ExpressJS application

mkdir <project_name>
cd <project_name>

npm init --y
npm install --save express

Create an Express server

In a file called index.js do:

const express = require('express');
const app = express();

app.use(express.static("<PATH_TO_YOUR_APP>/web"))
app.listen(process.env.PORT || 3007);

Do an ojet build in your web app folder. There should be a web folder. Ensure the newly created web folder is committed to git & GitHub

Setup a start script in package.json file

"scripts": {
      "start" : "node index.js"
  }

Deploy to heroku as per usual

https://www.heroku.com/nodejs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment