Skip to content

glennschler/glitch-hello-loopback4

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hello Loopback4 on Glitch

====================================================

====================================================

  1. [done] install Node.js
  2. [done] installed loopback version 4 using the following command:
pnpm install --save-dev @loopback/cli

Next Create a new Loopback4 project

  1. To create a new project, run the CLI as follow
  • First, open the Glitch console

  • Type the following command the console

    lb4 app
    
  • Answer the prompts as follows.

    [?] Project name: hello-loopback4
    [?] Project description: hello-loopback4
    [?] Project root directory: hello-loopback4
    [?] Application class name: HelloApplication
    [?] Select project build settings: Enable tslint, Enable prettier, Enable mocha, Enable loopbackBuild
    

    Choose features e.g.

Move the LB project files into the Glitch root

  • Move and edit the lb4 generated project files

    # move the lb4 generated project files
    mv ./hello-loopback4/README.md ./README-hello-loopback4.md
    
    # reference the generated README from this Glitch README
    sed -i '$a\
    [README-hello-loopback4](./README-hello-loopback4.md)' README.md
    
    mv ./hello-loopback4/{.[!.],}* .
    rm -r ./hello-loopback4
    
    # update to node version 10
    sed -i 's/>=8.9/10.x/' ./package.json
    
    # Sync Glitch console with the Glitch project
    refresh
    

Starting the project

  1. The project comes with a "ping" route to test the project. Let's try it out by running the projects.
  • Wait for Glitch project to finish rebuilding

  • In a browser, visit this Glitch remix

  • and with curl test the PING api

    curl -X GET "https://hello-loopback4-test01.glitch.me/ping" \
    -H  "accept: application/json"
    

Continue...

About

Follow the Loopback 4 tutorial using Glitch!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published