This is a Next.js project bootstrapped with create-next-app
.
npm install
2. Install nvm
Nvm is needed to locally link @livelike/javascript and install its dependencies.
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash
Add below lines in your .bashrc or .zshrc file
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
Check nvm available in CLI and install node v18.12.1
nvm install v18.12.1
Inside cloned repo with proper checked out branch
cd release/javascript
This globally links @livelike/javascript package
npm link
dependencies: {
"@livelike/javascript": "0.0.0",
}
npm run link-api
First, run the development server:
npm run dev
# or
yarn dev
Open http://localhost:3000/chatroom/6c5577e7-95cf-40ff-9a29-a6f57d0da322 with your browser to see the chat message. You can replace url chatroom Id with any other chat room id
You can start editing the page by modifying pages/chatroom/[roomId].tsx
. The page auto-updates as you edit the file.
API routes can be accessed on http://localhost:3000/api/hello. This endpoint can be edited in pages/api/hello.ts
.
The pages/api
directory is mapped to /api/*
. Files in this directory are treated as API routes instead of React pages.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!